mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-11-25 06:47:18 +00:00
add unattended flag to upgrade script
This commit is contained in:
parent
de3fadebc9
commit
b224ebc7dd
@ -131,39 +131,45 @@ reboot
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -e /tmp/dbgflag ]]; then
|
if [[ "$1" == "unattended" ]]; then
|
||||||
upgrade_mode_start
|
echo "Unattended upgrade!"
|
||||||
|
rm -rf /opt/Upgrade
|
||||||
|
sync
|
||||||
|
setup
|
||||||
else
|
else
|
||||||
|
|
||||||
if [ "$1" == "backup_begin" ]; then
|
if [[ -e /tmp/dbgflag ]]; then
|
||||||
backup_begin
|
upgrade_mode_start
|
||||||
else
|
else
|
||||||
|
|
||||||
read -r -p "${1:-wz_mini, this will download the latest version from github and upgrade your system. Are you sure? [y/N]} " response
|
if [ "$1" == "backup_begin" ]; then
|
||||||
case "$response" in
|
backup_begin
|
||||||
[yY][eE][sS]|[yY])
|
else
|
||||||
if [[ -d /opt/Upgrade ]]; then
|
|
||||||
echo "WARNING: Old Upgrade directory exists"
|
|
||||||
read -r -p "${1:-Unable to proceed, must DELETE old Upgrade directory, are you sure? [y/N]} " response
|
|
||||||
case "$response" in
|
|
||||||
[yY][eE][sS]|[yY])
|
|
||||||
rm -rf /opt/Upgrade
|
|
||||||
sync
|
|
||||||
setup
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "User denied directory removal, exit"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "User declined system update, exit"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
read -r -p "${1:-wz_mini, this will download the latest version from github and upgrade your system. Are you sure? [y/N]} " response
|
||||||
|
case "$response" in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
if [[ -d /opt/Upgrade ]]; then
|
||||||
|
echo "WARNING: Old Upgrade directory exists"
|
||||||
|
read -r -p "${1:-Unable to proceed, must DELETE old Upgrade directory, are you sure? [y/N]} " response
|
||||||
|
case "$response" in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
rm -rf /opt/Upgrade
|
||||||
|
sync
|
||||||
|
setup
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "User denied directory removal, exit"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
setup
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "User declined system update, exit"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user