-
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
![IBM System X3250 M3 Server 8GB RAM Intel Xeon x3440 2.53ghz (NO HDD) picture](/store/img/g/M~sAAOSwFVlkVr-r/s-l225/IBM-System-X3250-M3-Server-8GB-RAM-Intel-Xeon-x344.jpg)
IBM System X3250 M3 Server 8GB RAM Intel Xeon x3440 2.53ghz (NO HDD)
$36.53
![IBM System p5 9131-52A 3.5](/store/img/g/iZ4AAOSwcBxmYJo7/s-l225/IBM-System-p5-9131-52A-3-5-4-Bay-Server-80P6787-1-.jpg)
IBM System p5 9131-52A 3.5" 4-Bay Server 80P6787 1 CPU 2GB 6 HD CADDIES TAPE BU
$250.00
![IBM Server Rack Cabinet 9308-RC4 picture](/store/img/g/tSIAAOSwSUpmAe1K/s-l225/IBM-Server-Rack-Cabinet-9308-RC4.jpg)
IBM Server Rack Cabinet 9308-RC4
$209.00
![IBM Power S822 8284-22A 12SFF Power8 3.89GHz 6Core 64GB RAM No HDD Server System picture](/store/img/g/xiEAAOSwwGtmRmN6/s-l225/IBM-Power-S822-8284-22A-12SFF-Power8-3-89GHz-6Core.jpg)
IBM Power S822 8284-22A 12SFF Power8 3.89GHz 6Core 64GB RAM No HDD Server System
$359.99
![IBM System x3550 M3 Dual Intel Xeon X5650 @2.67GHz 32GB RAM No HDD picture](/store/img/g/oRsAAOSw~pRmQitC/s-l225/IBM-System-x3550-M3-Dual-Intel-Xeon-X5650-2-67GHz-.jpg)
IBM System x3550 M3 Dual Intel Xeon X5650 @2.67GHz 32GB RAM No HDD
$68.50
![IBM Power8 |S822 8284-22A 12-Bay Server | 1x 00UM260 CPU, 128GB RAM, No HDD's picture](/store/img/g/HT4AAOSwIVFmbKoy/s-l225/IBM-Power8-S822-8284-22A-12-Bay-Server-1x-00UM260-.jpg)
IBM Power8 |S822 8284-22A 12-Bay Server | 1x 00UM260 CPU, 128GB RAM, No HDD's
$237.15
![IBM Cloud Object Storage Slicestor 2448 E5-2637 3.5Ghz 128GB DDR4 - NO HDD - NEW picture](/store/img/g/HlcAAOSwAltmVnFr/s-l225/IBM-Cloud-Object-Storage-Slicestor-2448-E5-2637-3-.jpg)
IBM Cloud Object Storage Slicestor 2448 E5-2637 3.5Ghz 128GB DDR4 - NO HDD - NEW
$379.00
![IBM RS/6000 340 Server (7012-340) 33MHz 128MB RAM Computer Desktop Vintage picture](/store/img/g/FPsAAOSwVSpmIVKa/s-l225/IBM-RS-6000-340-Server-7012-340-33MHz-128MB-RAM-Co.jpg)
IBM RS/6000 340 Server (7012-340) 33MHz 128MB RAM Computer Desktop Vintage
$399.95
![IBM Netezza 3567 picture](/store/img/g/-uEAAOSw4ixmWekl/s-l225/IBM-Netezza-3567.jpg)
IBM Netezza 3567
$5000.00
![IBM Server System X3100 M4 | Xeon @ 3.10 Ghz | 8GB | 250GB HDD No OS (IG-PC26) picture](/store/img/g/vCUAAOSwSJhlCJV3/s-l225/IBM-Server-System-X3100-M4-Xeon-3-10-Ghz-8GB-250GB.jpg)
IBM Server System X3100 M4 | Xeon @ 3.10 Ghz | 8GB | 250GB HDD No OS (IG-PC26)
$112.95