Browse Source

add script to refresh shortcuts, uninstall machete

master
filesite 5 months ago
parent
commit
eedae5310d
  1. 21
      funs.sh
  2. 12
      refresh.sh
  3. 23
      uninstall.sh
  4. 1
      upgrade.sh

21
funs.sh

@ -21,6 +21,16 @@ theend () {
echo "" echo ""
} }
# 显示卸载信息
goodbye () {
echo ""
echo "==即将卸载machete,不会影响本地保存的照片、视频=="
echo "* 停止machete容器"
echo "* 删除machete容器"
echo "* 删除桌面快捷方式"
echo ""
}
# 获取用户桌面绝对路径 # 获取用户桌面绝对路径
getHomePath () { getHomePath () {
path=`cd ~/ && pwd` path=`cd ~/ && pwd`
@ -218,6 +228,17 @@ createShortcuts () {
fi fi
} }
# 删除桌面快捷方式
deleteShortcuts () {
type=$1
if [ "${type}" == "album" ]; then
rm -f ~/Desktop/相册.url
else
rm -f ~/Desktop/视频.url
fi
}
# 升级docker容器里的代码到最新版 # 升级docker容器里的代码到最新版
upgradeMacheteInContainers () { upgradeMacheteInContainers () {
name=$1 name=$1

12
refresh.sh

@ -0,0 +1,12 @@
#!/bin/sh
# 引入公用方法
. ./funs.sh
container=$1
if [ -z "${container}" ]; then
container="album"
fi
# ===== 更新快捷方式ip地址 =====
createShortcuts "${container}"

23
uninstall.sh

@ -0,0 +1,23 @@
#!/bin/sh
# 引入公用方法
. ./funs.sh
container=$1
if [ -z "${container}" ]; then
container="album"
fi
# ===== 卸载machete =====
goodbye
echo ""
echo "正在停止machete容器..."
docker stop "machete_${container}"
echo "正在删除machete容器..."
docker rm "machete_${container}"
echo "正在删除桌面快捷方式..."
deleteShortcuts "${container}"
echo "${container}卸载完成"
echo ""

1
upgrade.sh

@ -8,4 +8,5 @@ if [ -z "${container}" ]; then
container="album" container="album"
fi fi
# ===== 升级machete =====
upgradeMacheteInContainers "${container}" upgradeMacheteInContainers "${container}"

Loading…
Cancel
Save