diff --git a/check.bash b/check.bash index adee409..6002b3d 100755 --- a/check.bash +++ b/check.bash @@ -50,8 +50,12 @@ function copy_config() { echo $arcdir mkslf=$(which makeself.sh) echo $mkslf - $mkslf --gzip $tmpdir $arcdir/restore.run "SFX archive for backup" echo "Extraction done" + cp ./restore.bash $tmpdir + $mkslf --gzip $tmpdir $arcdir/restore.run "SFX archive for restoration" ./restore.bash + cp $arcdir/restore.run ./ + chown kake26:kake26 restore.run cprint 2 "Done!" + } function menu_option_two() { diff --git a/restore.bash b/restore.bash old mode 100644 new mode 100755 index df2ac02..d6f6c16 --- a/restore.bash +++ b/restore.bash @@ -22,3 +22,35 @@ function press_enter() { clear } +function restore_config() { + cprint 2 "Restoring config files..." + sleep 1 + + cprint 2 "Done!" +} + +# Check for root only important on pure Debian as there is no sudo by default +if [ "$(id -u)" != "0" ]; then + # check is the system is debian + if [ -f /etc/debian_version ]; then + cprint 3 "Notice: This script may need to be run as root on Debian, especially if its a stock install. Also requires makeself to created a distributable self restorable package" ; press_enter ; + fi +fi + +until [ "$selection" = "0" ]; do +clear + echo "" + cprint 3 " Main Menu" + mprint 1 "Restore" + mprint 0 "Exit" + echo "" + echo -n " Enter selection: " + read selection + echo "" + case $selection in + 1 ) clear ; restore_config ; press_enter ;; + 2 ) clear ; menu_option_two ; press_enter ;; + 0 ) clear ; exit ;; + * ) clear ; incorrect_selection ; press_enter ;; + esac +done \ No newline at end of file