mirror of https://github.com/tteck/Proxmox.git
tweak
This commit is contained in:
parent
c3658c260f
commit
54da0726a4
|
@ -52,75 +52,22 @@ function default_settings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 2 \
|
||||||
if [[ ! -d /opt/AdGuardHome ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
"1" "Update LXC OS" ON \
|
||||||
printf "\n${BL}*********************************************${CL}\n"
|
"2" "Manually Update $APP" OFF \
|
||||||
printf "${BL}**${YW} 1)${CL} Update LXC OS \n"
|
3>&1 1>&2 2>&3)
|
||||||
printf "${BL}**${YW} 2)${CL} Update AdGuardHome\n"
|
|
||||||
printf "${BL}*********************************************${CL}\n"
|
|
||||||
printf "Please choose an option from the menu, or ${RD}x${CL} to exit."
|
|
||||||
read opt
|
|
||||||
|
|
||||||
while [ "$opt" != "" ]; do
|
header_info
|
||||||
case $opt in
|
if [ "$UPD" == "1" ]; then
|
||||||
1)
|
apk update && apk upgrade
|
||||||
clear
|
exit;
|
||||||
echo -e "${RD}Update LXC OS${CL}"
|
fi
|
||||||
msg_info "Updating LXC OS"
|
|
||||||
apk update &>/dev/null
|
|
||||||
apk upgrade &>/dev/null
|
|
||||||
msg_ok "Update Successfull"
|
|
||||||
|
|
||||||
break
|
if [ "$UPD" == "2" ]; then
|
||||||
;;
|
header_info
|
||||||
2)
|
echo "In the process of creating a method to update"
|
||||||
clear
|
exit;
|
||||||
echo -e "${RD}Update AdGuardHome${CL}"
|
fi
|
||||||
msg_info "Stopping AdguardHome"
|
|
||||||
/opt/AdGuardHome/AdGuardHome -s stop &>/dev/null
|
|
||||||
msg_ok "Stopped AdguardHome"
|
|
||||||
|
|
||||||
VER=$(curl -sqI https://github.com/AdguardTeam/AdGuardHome/releases/latest | awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}');
|
|
||||||
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
|
|
||||||
mkdir -p adguard-backup
|
|
||||||
cp -rf /opt/AdGuardHome/AdGuardHome.yaml /opt/AdGuardHome/data adguard-backup/
|
|
||||||
cp AdGuardHome/AdGuardHome /opt/AdGuardHome/AdGuardHome
|
|
||||||
cp -r adguard-backup/* /opt/AdGuardHome/
|
|
||||||
msg_ok "Updated AdguardHome"
|
|
||||||
|
|
||||||
msg_info "Starting AdguardHome"
|
|
||||||
/opt/AdGuardHome/AdGuardHome -s start &>/dev/null
|
|
||||||
msg_ok "Started AdguardHome"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf AdGuardHome_linux_amd64.tar.gz AdGuardHome adguard-backup
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
msg_ok "Update Successfull"
|
|
||||||
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
x)
|
|
||||||
clear
|
|
||||||
echo -e "⚠ User exited script \n"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
\n)
|
|
||||||
clear
|
|
||||||
echo -e "⚠ User exited script \n"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
clear
|
|
||||||
echo -e "Please choose an option from the menu"
|
|
||||||
update_script
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|
|
@ -15,8 +15,6 @@ update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apk add newt
|
$STD apk add newt
|
||||||
$STD apk add wget
|
|
||||||
$STD apk add bash
|
|
||||||
$STD apk add curl
|
$STD apk add curl
|
||||||
$STD apk add nano
|
$STD apk add nano
|
||||||
$STD apk add mc
|
$STD apk add mc
|
||||||
|
|
|
@ -14,7 +14,7 @@ network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apk add bash
|
$STD apk add newt
|
||||||
$STD apk add curl
|
$STD apk add curl
|
||||||
$STD apk add openssl
|
$STD apk add openssl
|
||||||
$STD apk add openssh
|
$STD apk add openssh
|
||||||
|
|
Loading…
Reference in New Issue