mirror of https://github.com/tteck/Proxmox.git
menu
This commit is contained in:
parent
db58c365b5
commit
6464229f14
|
@ -29,74 +29,37 @@ variables
|
||||||
color
|
color
|
||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function default_settings() {
|
|
||||||
CT_TYPE="1"
|
|
||||||
PW="-password alpine"
|
|
||||||
CT_ID=$NEXTID
|
|
||||||
HN=$NSAPP
|
|
||||||
DISK_SIZE="$var_disk"
|
|
||||||
CORE_COUNT="$var_cpu"
|
|
||||||
RAM_SIZE="$var_ram"
|
|
||||||
BRG="vmbr0"
|
|
||||||
NET=dhcp
|
|
||||||
GATE=""
|
|
||||||
DISABLEIP6="no"
|
|
||||||
MTU=""
|
|
||||||
SD=""
|
|
||||||
NS=""
|
|
||||||
MAC=""
|
|
||||||
VLAN=""
|
|
||||||
SSH="no"
|
|
||||||
VERB="no"
|
|
||||||
echo_default
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
normal=$(tput sgr0)
|
|
||||||
menu=$(tput setaf 6)
|
|
||||||
number=$(tput setaf 3)
|
|
||||||
fgred=$(tput setaf 1)
|
|
||||||
|
|
||||||
header_info
|
header_info
|
||||||
printf "\n${menu}*********************************************${normal}\n"
|
PS3="Please choose an option from the menu, or enter q to exit: "
|
||||||
printf "${menu}**${number} 1)${normal} Update Vaultwarden\n"
|
options=("Update Vaultwarden" "View Admin Token" "Exit")
|
||||||
printf "${menu}**${number} 2)${normal} View Admin Token\n"
|
select opt in "${options[@]}"
|
||||||
printf "\n${menu}*********************************************${normal}\n"
|
do
|
||||||
printf "Please choose an option from the menu, or ${fgred}x${normal} to exit.\n"
|
|
||||||
read opt
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
case $opt in
|
case $opt in
|
||||||
1)
|
"Update Vaultwarden")
|
||||||
clear
|
clear
|
||||||
echo -e "${fgred}Update Vaultwarden${normal}"
|
echo "Updating Vaultwarden..."
|
||||||
apk update &>/dev/null
|
apk update &>/dev/null
|
||||||
apk upgrade &>/dev/null
|
apk upgrade &>/dev/null
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
2)
|
"View Admin Token")
|
||||||
clear
|
clear
|
||||||
echo -e "${fgred}View the Admin Token${normal}"
|
echo "Viewing the Admin Token..."
|
||||||
token=$(awk -F'"' '/ADMIN_TOKEN/{print $2}' /etc/conf.d/vaultwarden)
|
token=$(awk -F'"' '/ADMIN_TOKEN/{print $2}' /etc/conf.d/vaultwarden)
|
||||||
if [ -n "$token" ]; then
|
if [ -n "$token" ]; then
|
||||||
echo "Admin Token: $token"
|
echo "Admin Token: $token"
|
||||||
else
|
else
|
||||||
echo "Failed to retrieve the Admin Token."
|
echo "Failed to retrieve the Admin Token."
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
x|\n)
|
"Exit")
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
*)
|
*) echo "Invalid option. Please choose an option from the menu.";;
|
||||||
clear
|
|
||||||
echo -e "${fgred}Invalid option. Please choose an option from the menu.${normal}"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
read -p "Press Enter to continue..."
|
|
||||||
update_script
|
|
||||||
done
|
done
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|
Loading…
Reference in New Issue