以CentOS 7为例:
- 将此脚本保存为alist,复制到 /usr/local/sbin
#!/bin/bash
alist(){
if [ "$1" == "update" ];then
curl -fsSL "https://nn.ci/alist.sh" | bash -s update /www/wwwroot/dl.bywwh.com/alist
fi
}
case "$1" in
'update')
alist update
;;
*)
echo -e "\033[31mSelect Error!\033[0m"
;;
esac
- 运行以下命令:
chmod 777 /usr/local/sbin/alist
alist update
- 运行结果: