feat: 🎸 支持升级

This commit is contained in:
xubiaolin 2023-02-16 11:29:41 +08:00
parent 7e416e6935
commit 3a9885fcb8

View File

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
function deploy() {
imageName="zerotier-planet" imageName="zerotier-planet"
function deploy() {
# 处理ip信息 # 处理ip信息
curr_ip=$(curl -s cip.cc | grep http | awk -F '/' '{print $4}') curr_ip=$(curl -s cip.cc | grep http | awk -F '/' '{print $4}')
@ -52,11 +53,18 @@ function deploy() {
docker cp zerotier-planet:/app/bin/planet /tmp/planet docker cp zerotier-planet:/app/bin/planet /tmp/planet
} }
function upgrade(){
echo "准备更新zerotier服务"
docker exec $imageName bash -c "apt update && apt upgrade zerotier-one" -y
docker restart $imageName
echo "done!"
}
function menu() { function menu() {
echo echo
echo "=============功能菜单=============" echo "=============功能菜单============="
echo "| 1 - 安装" echo "| 1 - 安装"
#echo "| 2 - 更新" echo "| 2 - 更新"
#echo "| 3 - 卸载" #echo "| 3 - 卸载"
echo "| q - 退出" echo "| q - 退出"
echo "---------------------------------" echo "---------------------------------"
@ -67,8 +75,8 @@ function menu() {
echo "安装" echo "安装"
deploy deploy
#elif [ "$n" = "2" ]; then elif [ "$n" = "2" ]; then
# echo $n upgrade
#elif [ "$n" = "3" ]; then #elif [ "$n" = "3" ]; then
# echo $n # echo $n
elif [ "$n" = "q" ]; then elif [ "$n" = "q" ]; then