日常更新脚本
#!/bin/bashsource /etc/profiletouch "/tmp/game-action.lock"function Check_shell() { if [[ -s "/tmp/game-action.lock" ]] then echo -e "\e[31m脚本正在运行\e[0m" sleep 5 Check_shell else echo $$ >/tmp/game-action.lockfi}function Json_Update() { cd /home/qipai/hall37/ sh game.sh -a config_update echo "========Update json done!========"}function main(){ if [[ $USER != "qipai" ]] then echo "Please use qipai account" exit fi Json_Update }Check_shellmain>/tmp/game-action.lock