-
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>>
Similar Threads
-
By csodabogar in forum MS Windows & New to Linux
Replies: 3
Last Post: 10-10-2006, 04:30 PM
-
By punksm4ck in forum General Support
Replies: 4
Last Post: 04-13-2005, 05:48 PM
-
By quiquedcode in forum General Support
Replies: 1
Last Post: 07-16-2004, 11:35 AM
-
By gohan in forum Hardware & Booting
Replies: 3
Last Post: 02-25-2004, 02:50 PM
-
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
-
Forum Rules

Commodore Amiga 1010 External 3.5” Floppy Drive A500 A1000 A2000 Tested Working
$169.99

Commodore Amiga 500 Vintage Computer A500 No Power Supply
$249.95

ARexx User's Reference Manual The REXX Language for Amiga 1000 Vintage Computing
$22.12

Vintage Commodore Amiga A500 Computer with Power Supply & Tank Mouse - Untested
$400.00

TerribleFire TF1260 Amiga 1200 Accelerator - 68060 Rev.6 50MHz 128MB RAM + IDE
$499.00

Vtg Amiga Computer Monitor Commodore 13" Screen W/ Power Cord Powers On As Is
$279.95

Commodore Amiga 600 Computer w/ PIStorm Framethrower Recapped, Caffeine OS NTSC
$799.99

DKB MegAChip 2MB CHIP RAM for Commodore Amiga 2000 2000HD 2500 Video Toaster LRG
$339.98

ZuluSCSI Compact RP2040 - an affordable SCSI-2 (and 1) emulator w/ USB-C
$45.00

OPEN BOX - AMIGA Genlock Interface Vintage Video Adapter 1300- GREAT
$329.95