welcome()
{
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü " --title " Willkommen " --colors --ok-label "Weiter"\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü " --title " Willkommen " --colors --ok-label "Weiter"\
--hfile help.txt --exit-label "Schließen" --msgbox "\nRescueSys hat entdeckt, dass Sie noch nie eine Sicherung"`
`" durchgeführt haben. Daher müssen Sie zunächst notwendige Einstellungen vornehmen.\n\nDiese Daten werden gespeichert"`
`" und beim nächsten Start von RescueSys benutzt." 12 60
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Modus "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Modus "\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --radiolist "Im welchen Modus wollen Sie die Sicherung und"`
`" Wiederherstellung vornehmen?" 10 60 2\
USB "USB-Laufwerk" $usb_switch\
dd if=$FIFO iflag=nonblock &> /dev/null
# show 1st dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " USB-Laufwerk "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " USB-Laufwerk "\
--hfile help.txt --colors --nocancel --nook --infobox "Stecken Sie das USB-Laufwerk, auf dem die Sicherung erfolgen"`
`" soll, jetzt ein.\n\nIst das Laufwerk schon eingesteckt, dann entfernen Sie es und stecken es wieder ein." 8 50
sudo umount $INSP_DIR &> /dev/null
# show 2nd dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " USB-Laufwerk "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " USB-Laufwerk "\
--hfile help.txt --colors --yes-label "Ja" --no-label "Nein" --yesno "$text" 10 40 2>$OUT
# examine result
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Benutzername "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Benutzername "\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --inputbox "Geben Sie ihren Benutzernamen ein (falls leer"`
`" wird \"guest\" verwendet):" 9 50 $init 2>$OUT
password()
{
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Passwort "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Passwort "\
--hfile help.txt --colors --nocancel --insecure --ok-label "Weiter" --passwordbox "Geben Sie ihr Passwort ein (falls"`
`" leer wird \"guest\" verwendet):" 9 50 2>$OUT
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Domäne "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Domäne "\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --inputbox "Geben Sie den Domänennamen ein (falls leer wird"`
`" \"workgroup\" verwendet):" 9 50 $init 2>$OUT
done
# show dialog
- eval dialog --backtitle "\"RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen\"" --title "\" Netzwerkgerät \""\
+ eval dialog --backtitle "\"RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen\"" --title "\" Netzwerkgerät \""\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --radiolist "\"Welches Netzwerkgerät soll verwendet werden?\""\
10 50 5 ${list[@]} 2>$OUT
# handle a wireless interface by showing a dialog...
if [ "$type" = "wlan" ]; then
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " WPA Einstellungen "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " WPA Einstellungen "\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --form "Tragen Sie die Zugangsdaten ihres WPA/WPA2"`
`" Netzwerks ein:" 11 50 3\
"Name (SSID):" 1 1 "" 1 18 26 0\
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Automatisches Herunterfahren "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Automatisches Herunterfahren "\
--colors --yes-label "Ja" --no-label "Nein" --hfile help.txt --exit-label "Schließen" --default-button $init\
--yesno "\nSoll der Computer nach einer Sicherung oder Wiederhestellung automatisch heruntergefahren werden?"\
9 40 2>$OUT
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Laufwerksbereinigung "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Laufwerksbereinigung "\
--colors --yes-label "Ja" --no-label "Nein" --hfile help.txt --exit-label "Schließen" --default-button $init\
--yesno "\nSoll vor einer Sicherung das Laufwerk bereinigt werden, so das die Sicherungsdatei so klein wie möglich"`
`" ausfällt?\n\Z1ACHTUNG: Bei der Wahl dieser Option kann das Laufwerk beschädigt werden, falls des Computer im"`
# no store dialog: error dialog for unmountable network drive
no_store()
{
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Fehler " --hfile help.txt\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Fehler " --hfile help.txt\
--colors --ok-label "Abbrechen" --exit-label "Schließen" --msgbox "\nLaufwerk konnte nicht eingebunden werden."`
`" Bitte Einstellungen überprüfen und erneut versuchen." 9 50
}
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Netzlaufwerk "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Netzlaufwerk "\
--hfile help.txt --colors --nocancel --ok-label "Weiter" --exit-label "Schließen" --inputbox "Geben Sie den Pfad"`
`" komplett an:\n(\\\\server\\kompletter\\pfad)" 9 60 $init 2>$OUT
done
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen / Inspizieren" --hfile help.txt\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen / Inspizieren" --hfile help.txt\
--title " Datenträgerdetails " --exit-label "Schließen" --colors --nocancel --exit-label "Zurück"\
--textbox /tmp/inspect_file 23 60
}
done
# show dialog
- eval dialog --backtitle "\"RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen\"" --exit-label "Schließen"\
+ eval dialog --backtitle "\"RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen\"" --exit-label "Schließen"\
--title "\" Datenträger \"" --hfile help.txt --colors --nocancel --ok-label "Weiter"\
--extra-button --extra-label "Inspizieren" --checklist "\"Wählen Sie einen oder mehrere Datenträger aus, die Sie"`
`" sichern wollen - ausgewählte Datenträger können vorher inspiziert werden:\"" 14 50 4 ${entries[@]} 2>$OUT
backup_choice="$(cat $OUT)"
if [ -z "$backup_choice" ]; then
# show error
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Fehler "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Einstellungen" --title " Fehler "\
--colors --ok-label "Weiter" --hfile help.txt --exit-label "Schließen" --msgbox "\nBitte wählen Sie"`
`" mindestens ein Laufwerk aus." 8 40
ext_cleanup()
{
local progress=$((($1-1)*100/$2))
- echo $progress | dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
+ echo $progress | dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
--title " Bereinigung $1/$2 " --hfile help.txt --exit-label "Schließen" --gauge "\nBereinigung der EXT2/3/4 Partition"`
`" $3 läuft..." 8 56
vfat_cleanup()
{
local progress=$((($1-1)*100/$2))
- echo $progress | dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
+ echo $progress | dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
--title " Bereinigung $1/$2 " --hfile help.txt --exit-label "Schließen" --gauge "\nBereinigung der FAT Partition $3"`
`" läuft..." 8 56
ntfs_cleanup()
{
local progress=$((($1-1)*100/$2))
- echo $progress | dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
+ echo $progress | dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
--title " Bereinigung $1/$2 " --hfile help.txt --exit-label "Schließen" --gauge "\nBereinigung der NTFS Partition"`
`" $3 läuft..." 8 56
backup()
{
# confirm action
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Sicherung bestätigen "\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Sicherung bestätigen "\
--hfile help.txt --colors --yes-label "Weiter" --no-label "Abbrechen" --exit-label "Schließen" --yesno "\nWollen Sie"`
`" das/die Laufwerk/e \Z4${backup_choice}\Zn nach \Z4${store_path}\Zn sichern?" 9 50 2>$OUT
echo -n "" > $PROGRESS_FILE &>/dev/null
(sudo dd if=/dev/$disk $dd_opts 2>/dev/null | pv -s ${psize}k -n 2>$PROGRESS_FILE | sudo 7zr a -t7z -m0=lzma2 -mx=9\
-mfb=64 -md=32m -ms=on -bd -si $MNT_DIR/$arch_name 2>/dev/null | : | tail -fn0 $PROGRESS_FILE 2>>/dev/null |\
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --colors\
--title " Sicherung $i/$count " --hfile help.txt --exit-label "Schließen" --gauge "Sicherung von \Z4${disk}\Zn als"`
`" \Z4${store_path}\\$arch_name\Zn" 8 60)&
let 'i=i+1'
# test archive
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Überprüfung " --hfile help.txt\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Überprüfung " --hfile help.txt\
--colors --exit-label "Schließen" --infobox "Backupdatei \Z4${store_path}\\$arch_name\Zn wird überprüft..." 7 60\
2>$OUT
sudo 7zr t $MNT_DIR/$arch_name &>/dev/null
if [ $? -ne 0 ]; then
# show error messages
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Fehler " --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Sichern" --title " Fehler " --colors\
--hfile help.txt --exit-label "Schließen" --msgbox "\nBei der Erstellung der Sicherung von \Z4${disk}\Zn als"`
`" \Z4${store_path}\\$arch_name\Zn ist ein Fehler aufgetreten. Das Archiv ist ungültig und wird gelöscht. Die"`
`" Sicherung wird abgebrochen." 12 50
# param 1 is the list of disks that have been restored
mark4check()
{
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Überprüfung " --hfile help.txt\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Überprüfung " --hfile help.txt\
--colors --exit-label "Schließen" --infobox "Laufwerke werden für eine Überprüfung beim Start des Computers"`
`"markiert..." 6 60 2>$OUT
unset arch_names[${#arch_names[@]}-1] &> /dev/null
if ! [ -e $config_file ]; then
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Fehler " --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Fehler " --colors\
--ok-label "Abbrechen" --hfile help.txt --exit-label "Schließen" --msgbox "\nEs ist keine Sicherung vorhanden."`
`" Bitte erstellen Sie erste eine." 8 40
fi
# show dialog
while true; do
# show dialog
- eval dialog --backtitle "\"RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen\"" --hfile help.txt\
+ eval dialog --backtitle "\"RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen\"" --hfile help.txt\
--title "\" Wiederherstellung \"" --exit-label "Schließen" --colors --nocancel --ok-label "Weiter"\
--extra-button --extra-label "Abbrechen" --checklist "\"Wählen Sie einen oder mehrere Datenträger aus, die Sie"`
`" wiederherstellen wollen.\n\Z1Achtung:\Zn Alle Daten des/der Laufwerke/s werden überschrieben!\""\
if [ -z "$restore_choice" ]; then
# show error
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Fehler " --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --title " Fehler " --colors\
--ok-label "Weiter" --hfile help.txt --exit-label "Schließen" --msgbox "\nBitte wählen Sie mindestens ein"`
`" Laufwerk aus." 8 40
echo -n "" > $PROGRESS_FILE &>/dev/null
(sudo 7zr e -bd -so $MNT_DIR/backup_$arch_name.img 2>/dev/null | pv -s ${psize}k -n 2>$PROGRESS_FILE |\
sudo dd of=/dev/$disk conv=notrunc 2>/dev/null | : | tail -fn0 $PROGRESS_FILE 2>/dev/null |\
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Wiederherstellen" --colors\
--title " Wiederherstellung $i/$count " --hfile help.txt --exit-label "Schließen" --gauge "Wiederherstellung"`
`" von \Z4${disk}\Zn durch \Z4${store_path}\\backup_$arch_name.img\Zn" 8 60)&
# shutdown dialog: shutdowns the computer
shutdown_computer()
{
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Beenden" --title " Beenden " --nocancel --nook\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Beenden" --title " Beenden " --nocancel --nook\
--hfile help.txt --exit-label "Schließen" --pause "\nSekunden bis der Rechner heruntergefahren wird:" 9 40 5
# unmount store, shutdown and keeps script waiting for a while
local password=$(if [ -z "$pass" ]; then echo "<fehlt>"; else echo "<gesetzt>"; fi)
if ! [ "$mode" == "USB" ]; then
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Übersicht" --title " Übersicht " --nocancel\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Übersicht" --title " Übersicht " --nocancel\
--ok-label "Zurück" --hfile help.txt --exit-label "Schließen" --form "Übersicht der Einstellungen:" 16 65 9\
"Modus:" 1 2 "$mode" 1 26 -30 30\
"Benutzername:" 2 2 "$user" 2 26 -30 30\
"Laufwerke bereinigen:" 8 2 "$cleanup" 8 26 -30 30\
"Autom. Herunterfahren:" 9 2 "$auto_down" 9 26 -30 30 2>$OUT
else
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü / Übersicht" --title " Übersicht " --nocancel\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü / Übersicht" --title " Übersicht " --nocancel\
--ok-label "Zurück" --hfile help.txt --exit-label "Schließen" --form "Übersicht der Einstellungen:" 13 65 6\
"Modus:" 1 2 "$mode" 1 26 -30 30\
"Benutzername:" 2 2 "$user" 2 26 -30 30\
main_menu()
{
while true; do
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe - Hauptmenü " --title " Hauptmenü " --colors --nocancel\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe - Hauptmenü " --title " Hauptmenü " --colors --nocancel\
--hfile help.txt --exit-label "Schließen" --menu "Bitte Funktion auswählen:" 12 70 5\
Sichern "Erstellt eine Sicherung"\
Wiederherstellen "Stellt den Zustand aus einer Sicherung her"\
fi
# show dialog
- dialog --backtitle "RescueSys v1.0 - F1 für Hilfe" --title " Applikation schließen " --hfile help.txt --colors\
+ dialog --backtitle "RescueSys v2.0 - F1 für Hilfe" --title " Applikation schließen " --hfile help.txt --colors\
--cancel-label "Abbrechen" --insecure --ok-label "Schließen" --passwordbox "${error}Geben Sie das Passwort ein:"\
9 33 2>$OUT