我对编程知之甚少,我需要一些帮助。 我查看了其他帖子,但一直找不到有帮助的帖子。
#!/bin/bash
session="Golf5"
if grep -q /Game/Maps/BR_Paradise "/home/ogvisualz/Servers/logs/termnial.log"; then
cp /home/ogvisualz/Servers/bkup/Ball5/garden/DefaultEngine.ini /home/ogvisualz/servers/Golf5/Tower/Config/
else
if grep -q /Game/Maps/BR_Garden "/home/ogvisualz/Servers/logs/termnial.log"; then
cp /home/ogvisualz/Servers/bkup/Ball5/midori/DefaultEngine.ini /home/ogvisualz/servers/Golf5/Tower/Config/
else
if grep -q /Game/Maps/BR_Midori "/home/ogvisualz/Servers/logs/termnial.log"; then
cp /home/ogvisualz/Servers/bkup/Ball5/paradise/DefaultEngine.ini /home/ogvisualz/servers/Golf5/Tower/Config/
else
if grep -q UNetConnection::Cleanup: "/home/ogvisualz/Servers/logs/termnial.log"; then
sleep 3
tmux kill-session -t Ball
else
if (tmux has-session -t "$session" 2> /dev/null); then
tmux kill-session -t Ball
else
unset TMUX && cd /home/ogvisualz/ && ./BallStart
fi
exit
fi
我试图制作一个旋转脚本(上传到Pastebin)来更改地图,但是当我运行它时它会不断吐出这个错误。
./ rotate.sh:line 25:语法错误:意外的文件结尾
任何建议?
操作系统:Ubuntu 15.10 Server x64
答案 0 :(得分:2)
if ...; then
#do_something
elif ...; then
#do_something
elif ...; then
#do_something
elif ...; then
#do_something
elif ...; then
#do_something
else
#do_something
fi
exit