mirror of https://github.com/tteck/Proxmox.git
added update menu + recommendations
This commit is contained in:
parent
e1623e2104
commit
b35b8b66e8
|
@ -353,6 +353,32 @@ header_info
|
|||
|
||||
function update_script() {
|
||||
header_info
|
||||
normal=$(echo "\033[m")
|
||||
menu=$(echo "\033[36m")
|
||||
number=$(echo "\033[33m")
|
||||
fgred=$(echo "\033[31m")
|
||||
printf "\n${menu}*********************************************${normal}\n"
|
||||
printf "${menu}**${number} 1)${normal} Update LXC OS \n"
|
||||
printf "${menu}**${number} 2)${normal} Update AdGuardHome\n"
|
||||
printf "${menu}*********************************************${normal}\n"
|
||||
printf "Please choose an option from the menu, or ${fgred}x${normal} to exit."
|
||||
read opt
|
||||
|
||||
while [ "$opt" != "" ]; do
|
||||
case $opt in
|
||||
1)
|
||||
clear
|
||||
echo -e "${fgred}Update LXC OS${normal}"
|
||||
msg_info "Updating LXC OS"
|
||||
apk update &>/dev/null
|
||||
apk upgrade &>/dev/null
|
||||
msg_ok "Update Successfull"
|
||||
|
||||
break
|
||||
;;
|
||||
2)
|
||||
clear
|
||||
echo -e "${fgred}Update AdGuardHome${normal}"
|
||||
msg_info "Stopping AdguardHome"
|
||||
/opt/AdGuardHome/AdGuardHome -s stop &>/dev/null
|
||||
msg_ok "Stopped AdguardHome"
|
||||
|
@ -361,7 +387,7 @@ VER=$(curl -sqI https://github.com/AdguardTeam/AdGuardHome/releases/latest | awk
|
|||
msg_info "Updating AdguardHome to $VER"
|
||||
wget -q "https://github.com/AdguardTeam/AdGuardHome/releases/download/$VER/AdGuardHome_linux_amd64.tar.gz"
|
||||
tar -xvf AdGuardHome_linux_amd64.tar.gz &>/dev/null
|
||||
if test -f "/opt/AdGuardHome/AdGuardHome.yaml"; then
|
||||
if [ -f "/opt/AdGuardHome/AdGuardHome.yaml"]; then
|
||||
mkdir -p adguard-backup
|
||||
cp -r /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome/data adguard-backup/
|
||||
cp AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome
|
||||
|
@ -377,6 +403,26 @@ msg_info "Cleaning Up"
|
|||
rm -rf AdGuardHome_linux_amd64.tar.gz AdGuardHome adguard-backup
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Update Successfull"
|
||||
|
||||
break
|
||||
;;
|
||||
x)
|
||||
echo -e "⚠ User exited script \n"
|
||||
exit
|
||||
;;
|
||||
\n)
|
||||
echo -e "⚠ User exited script \n"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
echo -e "Please choose an option from the menu"
|
||||
update_script
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -389,15 +435,14 @@ if command -v pveversion >/dev/null 2>&1; then
|
|||
install_script
|
||||
fi
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /opt/AdGuardHome/AdGuardHome ]]; then
|
||||
if ! command -v pveversion >/dev/null 2>&1 && [[ ! -f /opt/AdGuardHome ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
fi
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1 && [[ -f /opt/AdGuardHome/AdGuardHome ]]; then
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
update_script
|
||||
fi
|
||||
|
||||
|
||||
if [ "$VERB" == "yes" ]; then set -x; fi
|
||||
if [ "$CT_TYPE" == "1" ]; then
|
||||
FEATURES="nesting=1,keyctl=1"
|
||||
|
|
Loading…
Reference in New Issue