removed some bashisms

This commit is contained in:
lars 2006-06-01 23:48:10 +00:00
parent c2a3bd5210
commit 0aea72533f
3 changed files with 75 additions and 75 deletions

View file

@ -30,20 +30,20 @@ LIB_DIR=$(dirname "$0")
DEVICE_NAME_PREFIX="Disk #" DEVICE_NAME_PREFIX="Disk #"
# read the default setting file, if it exists # read the default setting file, if it exists
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox test -e /etc/default/cryptobox && . /etc/default/cryptobox
[ ! -e "$CONF_FILE" ] && echo "Could not find the configuration file: $CONF_FILE" >&2 && exit 1 test ! -e "$CONF_FILE" && echo "Could not find the configuration file: $CONF_FILE" >&2 && exit 1
# parse config file # parse config file
. "$CONF_FILE" . "$CONF_FILE"
[ ! -e "$CONF_FILE" ] && echo "Could not find the distribution specific configuration file: $CONF_FILE" >&2 && exit 1 test ! -e "$CONF_FILE" && echo "Could not find the distribution specific configuration file: $CONF_FILE" >&2 && exit 1
# parse the distribution specific file # parse the distribution specific file
. "$DISTRIBUTION_CONF" . "$DISTRIBUTION_CONF"
# check for writable log file # check for writable log file
[ -w "$LOG_FILE" ] || LOG_FILE=/tmp/$(basename "$LOG_FILE") test -w "$LOG_FILE" || LOG_FILE=/tmp/$(basename "$LOG_FILE")
# retrieve configuration directory # retrieve configuration directory
CONFIG_DIR="$(getent passwd $CRYPTOBOX_USER | cut -d ':' -f 6)/config" CONFIG_DIR="$(getent passwd $CRYPTOBOX_USER | cut -d ':' -f 6)/config"
@ -65,7 +65,7 @@ function log_msg()
{ {
# the log file is (maybe) not writable during boot - try # the log file is (maybe) not writable during boot - try
# before writing ... # before writing ...
[ -w "$LOG_FILE" ] || return 0 test -w "$LOG_FILE" || return 0
echo >>"$LOG_FILE" echo >>"$LOG_FILE"
echo "##### `date` #####" >>"$LOG_FILE" echo "##### `date` #####" >>"$LOG_FILE"
echo "$1" >>"$LOG_FILE" echo "$1" >>"$LOG_FILE"
@ -104,7 +104,7 @@ function config_set_value()
# parameters: SettingName [SettingValue] # parameters: SettingName [SettingValue]
# read from stdin if SettingValue is not defined # read from stdin if SettingValue is not defined
{ {
if [ $# -gt 1 ] if test $# -gt 1
then echo "$2" > "$CONFIG_DIR/$1" then echo "$2" > "$CONFIG_DIR/$1"
else cat - >"$CONFIG_DIR/$1" else cat - >"$CONFIG_DIR/$1"
fi fi
@ -275,23 +275,21 @@ function is_encrypted() {
} }
function get_available_disks() # list which allowed disks are at the moment connected with the cbox
# looks which allowed disks are at the moment connected with the cbox function get_available_disks() {
{
for scan in $SCAN_DEVICES for scan in $SCAN_DEVICES
do for avail in $ALL_PARTITIONS do for avail in $ALL_PARTITIONS
do echo "$avail" | grep -q "^$scan[0-9]*" && echo "/dev/$avail" do echo "$avail" | grep -q "^$scan[^/]*" && echo "/dev/$avail"
done done
done done
return 0 return 0
} }
function mount_crypto()
# Parameter: DEVICE # Parameter: DEVICE
{ function mount_crypto() {
local device=$1 local device=$1
[ -z "$device" ] && error_msg 4 'No valid harddisk found!' test -z "$device" && error_msg 4 'No valid harddisk found!'
is_mounted "$device" && echo "The crypto filesystem is already active!" && return is_mounted "$device" && echo "The crypto filesystem is already active!" && return
# passphrase is read from stdin # passphrase is read from stdin
log_msg "Mounting a crypto partition from $device" log_msg "Mounting a crypto partition from $device"
@ -332,16 +330,16 @@ export PATH=/usr/sbin:/usr/bin:/sbin:/bin
ACTION=help ACTION=help
[ $# -gt 0 ] && ACTION=$1 && shift test $# -gt 0 && ACTION=$1 && shift
case "$ACTION" in case "$ACTION" in
crypto-up ) crypto-up )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'crypto-up'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'crypto-up'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
mount_crypto "$1" mount_crypto "$1"
;; ;;
crypto-down ) crypto-down )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'crypto-down'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'crypto-down'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
umount_partition "$1" umount_partition "$1"
;; ;;
@ -349,7 +347,7 @@ case "$ACTION" in
init_cryptobox </dev/null >>"$LOG_FILE" 2>&1 init_cryptobox </dev/null >>"$LOG_FILE" 2>&1
;; ;;
list_container ) list_container )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'list_container'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'list_container'"
case "$1" in case "$1" in
config | unused | plaindata | crypto ) config | unused | plaindata | crypto )
list_partitions_of_type "$1" list_partitions_of_type "$1"
@ -362,13 +360,13 @@ case "$ACTION" in
;; ;;
get_device_name ) get_device_name )
# Parameter: DEVICE # Parameter: DEVICE
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'get_device_name'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'get_device_name'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
get_device_name "$1" get_device_name "$1"
;; ;;
set_device_name ) set_device_name )
# Parameter: DEVICE NAME # Parameter: DEVICE NAME
[ $# -ne 2 ] && error_msg 10 "invalid number of parameters for 'set_device_name'" test $# -ne 2 && error_msg 10 "invalid number of parameters for 'set_device_name'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
set_device_name "$1" "$2" set_device_name "$1" "$2"
;; ;;
@ -387,17 +385,17 @@ case "$ACTION" in
true true
;; ;;
is_mounted ) is_mounted )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'is_mounted'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'is_mounted'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
is_mounted "$1" is_mounted "$1"
;; ;;
is_encrypted ) is_encrypted )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'is_encrypted'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'is_encrypted'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
is_encrypted "$1" is_encrypted "$1"
;; ;;
is_plain ) is_plain )
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'is_plain'" test $# -ne 1 && error_msg 10 "invalid number of parameters for 'is_plain'"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
is_plain "$1" is_plain "$1"
;; ;;
@ -408,15 +406,15 @@ case "$ACTION" in
get_available_disks get_available_disks
;; ;;
set_config ) set_config )
[ $# -ne 2 ] && error_msg 7 "'set_config' requires two parameters" test $# -ne 2 && error_msg 7 "'set_config' requires two parameters"
config_set_value "$1" "$2" config_set_value "$1" "$2"
;; ;;
get_config ) get_config )
[ $# -ne 1 ] && error_msg 6 "'get_config' requires exactly one parameter" test $# -ne 1 && error_msg 6 "'get_config' requires exactly one parameter"
config_get_value "$1" config_get_value "$1"
;; ;;
get_capacity_info ) get_capacity_info )
[ $# -ne 1 ] && error_msg 6 "'get_capacity_info' requires exactly one parameter" test $# -ne 1 && error_msg 6 "'get_capacity_info' requires exactly one parameter"
is_device_allowed "$1" || error_msg 12 "invalid device: $1" is_device_allowed "$1" || error_msg 12 "invalid device: $1"
is_mounted "$1" || error_msg 13 "the device is not mounted: $1" is_mounted "$1" || error_msg 13 "the device is not mounted: $1"
name=$(get_device_mnt_name "$1") name=$(get_device_mnt_name "$1")

View file

@ -20,10 +20,10 @@ set -eu
LIB_DIR=$(dirname "$0") LIB_DIR=$(dirname "$0")
LIB_DIR=$(cd "$LIB_DIR"; pwd) LIB_DIR=$(cd "$LIB_DIR"; pwd)
[ "$(id -u)" -ne 0 ] && echo "$(basename $0) - only root may call this script" >&2 && exit 100 test "$(id -u)" -ne 0 && echo "$(basename $0) - only root may call this script" >&2 && exit 100
# read the default setting file, if it exists # read the default setting file, if it exists
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox test -e /etc/default/cryptobox && . /etc/default/cryptobox
# set CONF_FILE to default value, if not configured in /etc/default/cryptobox # set CONF_FILE to default value, if not configured in /etc/default/cryptobox
CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf} CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
@ -39,14 +39,14 @@ CONFIG_MARKER=cryptobox.marker
############ some useful functions ############### ############ some useful functions ###############
# check if the given device is part of the SCAN_DEVICE list # check if the given device is part of the SCAN_DEVICE list
# every entry in SCAN_DEVICES is matched as "^/dev/${SCAN_DEVICE}[0-9]*$" against # every entry in SCAN_DEVICES is matched as "^/dev/${SCAN_DEVICE}[^/]*$" against
# the given device # the given device
# other devices may not be touched # other devices may not be touched
function is_device_allowed() function is_device_allowed()
# parameter: device # parameter: device
{ {
for a in $SCAN_DEVICES for a in $SCAN_DEVICES
do [[ "$1" =~ "^/dev/${a}[0-9]*$" ]] && return 0 do echo "$1" | grep -q "^/dev/${a}[^/]*$" && return 0
done done
return 1 return 1
} }
@ -59,7 +59,7 @@ function get_device_uuid() {
# check for luksUUID or ext2/3-uuid # check for luksUUID or ext2/3-uuid
if is_luks_device "$1" if is_luks_device "$1"
then UUID=$("$CRYPTSETUP" luksUUID "$1") then UUID=$("$CRYPTSETUP" luksUUID "$1")
else [ -x "$BLKID" ] && UUID=$("$BLKID" -s UUID -o value -c /dev/null -w /dev/null "$1" 2>/dev/null) else test -x "$BLKID" && UUID=$("$BLKID" -s UUID -o value -c /dev/null -w /dev/null "$1" 2>/dev/null)
fi fi
if test -z "$UUID" if test -z "$UUID"
then get_device_flat_name "$1" then get_device_flat_name "$1"
@ -84,8 +84,7 @@ function get_device_mnt_name() {
# every devmapper name should look like a UUID # every devmapper name should look like a UUID
function is_uuid_valid() { function is_uuid_valid() {
local hex=[0-9a-f] local hex=[0-9a-f]
# TODO: this is very bash-specific - translate it to grep :) echo "$1" | grep -q "^$hex\{8\}-$hex\{4\}-$hex\{4\}-$hex\{4\}-$hex\{12\}$"
[[ "$1" =~ "^$hex\{8\}-$hex\{4\}-$hex\{4\}-$hex\{4\}-$hex\{12\}$" ]]
} }
@ -120,12 +119,12 @@ function is_luks_device()
################ main #################### ################ main ####################
ACTION=unknown ACTION=unknown
[ $# -gt 0 ] && ACTION=$1 && shift test $# -gt 0 && ACTION=$1 && shift
case "$ACTION" in case "$ACTION" in
partition_disk ) partition_disk )
[ $# -ne 2 ] && error_msg 1 "wrong number of parameters" test $# -ne 2 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
partition_device "$1" "$2" || \ partition_device "$1" "$2" || \
@ -134,7 +133,7 @@ case "$ACTION" in
mount ) mount )
# parameters: device # parameters: device
# returns the relative name of the mointpoint for success # returns the relative name of the mointpoint for success
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
mnt_name=$(get_device_mnt_name "$1") mnt_name=$(get_device_mnt_name "$1")
@ -162,7 +161,7 @@ case "$ACTION" in
;; ;;
umount ) umount )
#parameter: device #parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
mnt_name=$(get_device_mnt_name "$1") mnt_name=$(get_device_mnt_name "$1")
@ -184,9 +183,9 @@ case "$ACTION" in
;; ;;
create_crypto ) create_crypto )
# parameter: device keyfile # parameter: device keyfile
[ $# -ne 2 ] && error_msg 1 "wrong number of parameters" test $# -ne 2 && error_msg 1 "wrong number of parameters"
keyfile=$2 keyfile=$2
[ -e "$keyfile" ] || error_msg 2 "keyfile ($keyfile) not found" test -e "$keyfile" || error_msg 2 "keyfile ($keyfile) not found"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
# read the passphrase from stdin # read the passphrase from stdin
@ -208,31 +207,31 @@ case "$ACTION" in
error_msg 13 "failed to create the encrypted filesystem" error_msg 13 "failed to create the encrypted filesystem"
"$CRYPTSETUP" --batch-mode luksClose "$name" || \ "$CRYPTSETUP" --batch-mode luksClose "$name" || \
error_msg 14 "failed to close the encrypted mapped device" error_msg 14 "failed to close the encrypted mapped device"
) </dev/null &>/dev/null & ) </dev/null >/dev/null 2>/dev/null &
true true
;; ;;
create_plain ) create_plain )
# parameter: device # parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters for 'create_plain'" test $# -ne 1 && error_msg 1 "wrong number of parameters for 'create_plain'"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
# complete in background # complete in background
( (
"$MKFS_DATA" "$1" || \ "$MKFS_DATA" "$1" || \
error_msg 15 "failed to create the plaintext filesystem" error_msg 15 "failed to create the plaintext filesystem"
) </dev/null &>/dev/null & ) </dev/null >/dev/null 2>/dev/null &
true true
;; ;;
get_device_mnt_name ) get_device_mnt_name )
# parameter: device # parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
get_device_mnt_name "$1" get_device_mnt_name "$1"
;; ;;
get_device_uuid ) get_device_uuid )
# parameter: device # parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
get_device_uuid "$1" get_device_uuid "$1"
@ -240,7 +239,7 @@ case "$ACTION" in
is_config_partition ) is_config_partition )
# parameter: device # parameter: device
# returns exitcode 0 if the device contains a configuration # returns exitcode 0 if the device contains a configuration
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
is_config=0 is_config=0
@ -248,19 +247,19 @@ case "$ACTION" in
mkdir -p "$tmp_dir" mkdir -p "$tmp_dir"
# error means "no config partition" # error means "no config partition"
if mount "$1" "$CONFIG_DIR" if mount "$1" "$CONFIG_DIR"
then [ -e "$CONFIG_DIR/$CONFIG_MARKER" ] && is_config=1 then test -e "$CONFIG_DIR/$CONFIG_MARKER" && is_config=1
umount "$CONFIG_DIR" || \ umount "$CONFIG_DIR" || \
error_msg 14 "unable to unmount configation partition after probing" error_msg 14 "unable to unmount configation partition after probing"
fi fi
rmdir "$tmp_dir" || true rmdir "$tmp_dir" || true
# return 0 if $device is a config partition # return 0 if $device is a config partition
[ "$is_config" -eq 1 ] && exit 0 test "$is_config" -eq 1 && exit 0
exit 1 exit 1
;; ;;
is_crypto_partition ) is_crypto_partition )
# parameter: device # parameter: device
# returns exitcode 0 if the device contains a luks header # returns exitcode 0 if the device contains a luks header
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
is_luks_device "$1" is_luks_device "$1"
@ -268,14 +267,14 @@ case "$ACTION" in
is_plain_partition ) is_plain_partition )
# parameter: device # parameter: device
# returns exitcode 0 if the device contains a readable filesystem # returns exitcode 0 if the device contains a readable filesystem
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
status=0 status=0
tmp_dir=/tmp/$(basename $0)-$$-mnt tmp_dir=/tmp/$(basename $0)-$$-mnt
mkdir -p "$tmp_dir" mkdir -p "$tmp_dir"
if mount -o ro "$1" "$tmp_dir" if mount "$1" "$tmp_dir" >/dev/null 2>/dev/null
then [ ! -e "$tmp_dir/$CONFIG_MARKER" ] && status=1 then test ! -e "$tmp_dir/$CONFIG_MARKER" && status=1
umount "$tmp_dir" umount "$tmp_dir"
fi fi
rmdir "$tmp_dir" || true rmdir "$tmp_dir" || true
@ -284,14 +283,14 @@ case "$ACTION" in
;; ;;
trash_device ) trash_device )
# parameter: device # parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
dd if=/dev/urandom of="$1" bs=512 count=1 2>/dev/null dd if=/dev/urandom of="$1" bs=512 count=1 2>/dev/null
;; ;;
diskinfo ) diskinfo )
# parameter: device # parameter: device
[ $# -ne 1 ] && error_msg 1 "wrong number of parameters" test $# -ne 1 && error_msg 1 "wrong number of parameters"
is_device_allowed "$1" || \ is_device_allowed "$1" || \
error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)" error_msg 3 "this device ($1) is not listed in SCAN_DEVICES (see $CONF_FILE)"
"$SFDISK" -L -q -l "$1" "$SFDISK" -L -q -l "$1"
@ -300,8 +299,8 @@ case "$ACTION" in
# parameter: none # parameter: none
ip= ip=
# TODO: can we avoid to hard-code the filename ($CONFIG_DIR/ip) here? # TODO: can we avoid to hard-code the filename ($CONFIG_DIR/ip) here?
[ -e "$CONFIG_DIR/ip" ] && ip=$(<"$CONFIG_DIR/ip") test -e "$CONFIG_DIR/ip" && ip=$(<"$CONFIG_DIR/ip")
[ -n "$z" ] && ifconfig "$NET_IFACE" "$ip" test -n "$z" && ifconfig "$NET_IFACE" "$ip"
;; ;;
poweroff ) poweroff )
# TODO: check configuration setting before # TODO: check configuration setting before
@ -334,7 +333,7 @@ case "$ACTION" in
echo ' reboot' echo ' reboot'
echo ' help' echo ' help'
echo echo
[ "$ACTION" == "help" ] && exit 0 test "$ACTION" = "help" && exit 0
# return error for any unknown/unspecified action # return error for any unknown/unspecified action
exit 1 exit 1
;; ;;

View file

@ -2,26 +2,29 @@
<h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1> <h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1>
<?cs # is the disc active? ?> <?cs # is the disc accessible? ?>
<?cs if:!Data.CurrentDisk.active && (Data.CurrentDisk.encryption || Data.CurrentDisk.plaintext) ?> <?cs if:Data.CurrentDisk.encryption || Data.CurrentDisk.plaintext ?>
<h2>Mount container</h2> <?cs # is the disc active? ?>
<?cs call:print_form_header() ?> <?cs if:!Data.CurrentDisk.active ?>
<p> <h2>Mount container</h2>
<?cs if:Data.CurrentDisk.encryption ?> <?cs call:print_form_header() ?>
<label for="crypto_passwort"><?cs var:html_escape(Lang.Text.EnterCurrentCryptoPassword) ?></label> <p>
<input type="password" id="crypto_password" name="crypto_password" size="20" maxlength="40" /> <?cs if:Data.CurrentDisk.encryption ?>
<?cs /if ?> <label for="crypto_passwort"><?cs var:html_escape(Lang.Text.EnterCurrentCryptoPassword) ?></label>
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" /> <input type="password" id="crypto_password" name="crypto_password" size="20" maxlength="40" />
<input type="hidden" name="action" value="mount_do" /> <?cs /if ?>
<button type="submit"><?cs var:html_escape(Lang.Button.Mount) ?></button></p> <input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
</form> <input type="hidden" name="action" value="mount_do" />
<?cs else ?> <button type="submit"><?cs var:html_escape(Lang.Button.Mount) ?></button></p>
<h2>Unmount container</h2> </form>
<?cs call:print_form_header() ?> <?cs else ?>
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" /> <h2>Unmount container</h2>
<input type="hidden" name="action" value="umount_do" /> <?cs call:print_form_header() ?>
<button type="submit"><?cs var:html_escape(Lang.Button.Umount) ?></button></p> <p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
</form> <input type="hidden" name="action" value="umount_do" />
<button type="submit"><?cs var:html_escape(Lang.Button.Umount) ?></button></p>
</form>
<?cs /if ?>
<?cs /if ?> <?cs /if ?>
<?cs # name change is only possible if the volume is not mounted ?> <?cs # name change is only possible if the volume is not mounted ?>