你好,我的开发人员,所以最近我制作了这个脚本来安装和管理wireguard,所以我一直在尝试在我的shell脚本上添加一个用法,我需要一些帮助。
原始脚本 https://github.com/complexorganizations/wireguard-manager
用法: https ://github.com/complexorganizations/wireguard-manager/issues/170
我知道我犯了很多错误,有人可以看看并帮助我吗?
function usage-guide() {
echo "usage: ./"$(basename "$0")" [OPTIONS]"
echo " --install Install WireGuard Interface"
echo " --start Start WireGuard Interface"
echo " --stop Stop WireGuard Interface"
echo " --restart Restart WireGuard Interface"
echo " --list Show WireGuard Peers"
echo " --add Add WireGuard Peer"
echo " --remove Remove WireGuard Peer"
echo " --uninstall Uninstall WireGuard Interface"
echo " --update Update WireGuard Script"
exit
}
while [ "$1" != "" ]; do
case $1 in
--install)
shift
HEADLESS_INSTALL=${HEADLESS_INSTALL:-y}=$1
;;
--start)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-2}=$1
;;
--stop)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-3}=$1
;;
--restart)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-4}=$1
;;
--list)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-1}=$1
;;
--add)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-5}=$1
;;
--remove)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-6}=$1
;;
--uninstall)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-7}=$1
;;
--update)
shift
WIREGUARD_OPTIONS=${WIREGUARD_OPTIONS:-8}=$1
;;
esac
shift
done
```