Code Sample |
# Get the device name from argument $3 or /opt/.backup_device DEVICE="$3" || DEVICE="$(cat /opt/.backup_device 2>/dev/null)" # Exit if no device specified or if DEVICE is not a valid block device [ "x$DEVICE" = x -o ! -b "/dev/$DEVICE" ] && exit 1 |
Code Sample |
# Only store device name if backup/restore successful [ $1 -eq 0 ] && echo $(basename $DEVICE) >/opt/.backup_device # Remove password file if decryption fails [ $1 -eq 98 ] && rm -f /etc/sysconfig/des |
Code Sample |
w = Window{320,75, "Filetool"} input = Input{60,10,210,25,"Device:"} readfrom("/opt/.backup_device") input.value = read() cancel = Button{60,40,70,25,"&Cancel"} function cancel:callback() exit(0) end backup = Button{130,40,70,25,"&Backup"} function backup:callback() t = {"filetool.sh backup noprompt ".. input.value} call(execute, t) exit(0) end [ and ditto for the restore function ] etc |