日常更新脚本
#!/bin/bash source /etc/profile touch "/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.lock fi } 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_shell main >/tmp/game-action.lock