Results 1 to 3 of 3

Thread: PLEASE TELL ME WHAT THESE SCRIPTS ARE ABOUT? URGENT

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    6

    PLEASE TELL ME WHAT THESE SCRIPTS ARE ABOUT? URGENT

    extracted from knoppix-autoconfig:

    <<START>>

    # Try to mount this filesystem read-only, without or with encryption
    # trymount device|file mountpoint
    trymount(){
    # Check if already mounted
    case "$(cat /proc/mounts)" in *\ $2\ *) return 0;; esac
    # Create target directory if it doesn't exist yet
    [ -d "$2" ] || mkdir -p "$2"
    RC=""
    # Apparently, mount-aes DOES autodetect AES loopback files.
    [ -b "$1" ] && { mount -t auto -o ro "$1" "$2" 2>/dev/null; RC="$?"; }
    # We need to mount crypto-loop files with initial rw support
    [ -f "$1" ] && { mount -t auto -o loop,rw "$1" "$2" 2>/dev/null; RC="$?"; }
    # Mount succeeded?
    [ "$RC" = "0" ] && return 0
    echo ""
    echo "${CYAN}Filesystem not autodetected, trying to mount $1 with AES256 encryption${NORMAL}"
    sleep 2
    a="y"
    while [ "$a" != "n" -a "$a" != "N" ]; do
    # We need to mount crypto-loop files with initial rw support
    PW="$(dialog --title "Encrypted Partition?" --stdout --insecure --passwordbox "Please enter decryption password:" 8 40)"
    [ "$?" != "0" ] && break
    mount -p0 -t auto -o loop,rw,encryption=AES256 "$1" "$2" <<EOT
    $PW
    EOT
    [ "$?" = "0" ] && { unset PW; return 0; }
    unset PW
    echo -n "${RED}Mount failed, retry? [Y/n] ${NORMAL}"
    read a
    done
    return 1
    }

    <<END>>

    <<START>>

    # Try to mount this filesystem read-only, without or with encryption
    # trymount device|file mountpoint
    trymount(){
    # Check if already mounted
    case "$(cat /proc/mounts)" in *\ $2\ *) return 0;; esac
    # Create target directory if it doesn't exist yet
    [ -d "$2" ] || mkdir -p "$2"
    RC=""
    # Apparently, mount-aes DOES autodetect AES loopback files.
    [ -b "$1" ] && { mount -t auto -o ro "$1" "$2" 2>/dev/null; RC="$?"; }
    # We need to mount crypto-loop files with initial rw support
    [ -f "$1" ] && { mount -t auto -o loop,rw "$1" "$2" 2>/dev/null; RC="$?"; }
    # Mount succeeded?
    [ "$RC" = "0" ] && return 0
    echo ""
    echo "${CYAN}Filesystem not autodetected, trying to mount $1 with AES256 encryption${NORMAL}"
    sleep 2
    a="y"
    while [ "$a" != "n" -a "$a" != "N" ]; do
    # We need to mount crypto-loop files with initial rw support
    PW="$(dialog --title "Encrypted Partition?" --stdout --insecure --passwordbox "Please enter decryption password:" 8 40)"
    [ "$?" != "0" ] && break
    mount -p0 -t auto -o loop,rw,encryption=AES256 "$1" "$2" <<EOT
    $PW
    EOT
    [ "$?" = "0" ] && { unset PW; return 0; }
    unset PW
    echo -n "${RED}Mount failed, retry? [Y/n] ${NORMAL}"
    read a
    done
    return 1
    }

    <<END>>

    <<START>>

    # Try to mount this filesystem read-only, without or with encryption
    # trymount device|file mountpoint
    trymount(){
    # Check if already mounted
    case "$(cat /proc/mounts)" in *\ $2\ *) return 0;; esac
    # Create target directory if it doesn't exist yet
    [ -d "$2" ] || mkdir -p "$2"
    RC=""
    # Apparently, mount-aes DOES autodetect AES loopback files.
    [ -b "$1" ] && { mount -t auto -o ro "$1" "$2" 2>/dev/null; RC="$?"; }
    # We need to mount crypto-loop files with initial rw support
    [ -f "$1" ] && { mount -t auto -o loop,rw "$1" "$2" 2>/dev/null; RC="$?"; }
    # Mount succeeded?
    [ "$RC" = "0" ] && return 0
    echo ""
    echo "${CYAN}Filesystem not autodetected, trying to mount $1 with AES256 encryption${NORMAL}"
    sleep 2
    a="y"
    while [ "$a" != "n" -a "$a" != "N" ]; do
    # We need to mount crypto-loop files with initial rw support
    PW="$(dialog --title "Encrypted Partition?" --stdout --insecure --passwordbox "Please enter decryption password:" 8 40)"
    [ "$?" != "0" ] && break
    mount -p0 -t auto -o loop,rw,encryption=AES256 "$1" "$2" <<EOT
    $PW
    EOT
    [ "$?" = "0" ] && { unset PW; return 0; }
    unset PW
    echo -n "${RED}Mount failed, retry? [Y/n] ${NORMAL}"
    read a
    done
    return 1
    }

    <<END>>

  2. #2
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Urgent? When is your homework assignment due?

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    6
    By 22th of Oct

Similar Threads

  1. urgent need for little info. please help now!!!
    By csodabogar in forum MS Windows & New to Linux
    Replies: 3
    Last Post: 10-10-2006, 04:30 PM
  2. HELP PLEASE !!!URGENT!!! LINUX COMMAND HELP
    By punksm4ck in forum General Support
    Replies: 4
    Last Post: 04-13-2005, 05:48 PM
  3. [URGENT] Accept this challenge !
    By quiquedcode in forum General Support
    Replies: 1
    Last Post: 07-16-2004, 11:35 AM
  4. Monitor Issues!!! URGENT!
    By gohan in forum Hardware & Booting
    Replies: 3
    Last Post: 02-25-2004, 02:50 PM
  5. g un pb urgent!
    By dams in forum General Support
    Replies: 1
    Last Post: 12-26-2003, 03:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Vintage Atari STM1 Rollerball Two-Button Mouse Serial X5045136618 picture

Vintage Atari STM1 Rollerball Two-Button Mouse Serial X5045136618

$69.99



Atari Power Cube 800XL, 600XL, 65XE, 130XE  USB-C Power Supply PSU picture

Atari Power Cube 800XL, 600XL, 65XE, 130XE USB-C Power Supply PSU

$11.25



Atari Mega STE or TT Keyboard. Used.  Untested. picture

Atari Mega STE or TT Keyboard. Used. Untested.

$300.00



Rare Vintage Collectible Original Atari 800 Home Computer With Case - UNTESTED picture

Rare Vintage Collectible Original Atari 800 Home Computer With Case - UNTESTED

$219.99



Atari 400/800/XL/XE Computer SIO2PC - PC/Mac Disk Drive Emulator Adapter/Device picture

Atari 400/800/XL/XE Computer SIO2PC - PC/Mac Disk Drive Emulator Adapter/Device

$15.25



A8PicoCart Kit Atari XE XL unocart clone multicart cartridge game picture

A8PicoCart Kit Atari XE XL unocart clone multicart cartridge game

$18.95



Atari 410 Program Cassette Recorder Clean Tested for power/4 cassettes/Cover picture

Atari 410 Program Cassette Recorder Clean Tested for power/4 cassettes/Cover

$22.99



Vintage Atari 800XL Computer With Original Box  picture

Vintage Atari 800XL Computer With Original Box

$140.00



A8picoCart Atari 130 / 65 XE 800 / 1200 XL XEGS multicart UnoCart clone game picture

A8picoCart Atari 130 / 65 XE 800 / 1200 XL XEGS multicart UnoCart clone game

$32.95



ATARI Home Computers FAMILY FINANCES  Software  **SEALED NEW** 1982 picture

ATARI Home Computers FAMILY FINANCES Software **SEALED NEW** 1982

$25.00