I am making this code for a minecraft server plugin updater
I am a new shell scripter so I don't know alot...
when I run this code I get a error:
#!/bin/sh
export PATH=$PATH:.
#Options
PLUGINDOWNLOADLINK=http://api.bukget.org/3/plugins/bukkit/$PLUGINNAME/latest/download
# Plugin folder
if [ -f $PWDplugins ]; then
PLUG=$PWDplugins
else
PLUG=$PWDplug-ins
fi
cd $PLUG
if [ ! -f .update ]; then
mkdir update
echo Making Directory "update"..
fi
# Plugins Found
for i in $( ls );
do
PLUGINNAME=$i
done
cd .update
wget $PLUGINDOWNLOADLINK
# No Plugins Found
if [ ! -f $PLUG ]; then
echo
echo
echo No plugin found.
echo
echo
echo
echo Plugins can be downloaded here:
echo http://dev.bukkit.org/bukkit-plugins
fi
# stop
sleep 3s
exit
I get this error:
Syntax error: end of file unexpected (expecting "then")
so I put "then" in the place it wanted me to and ran it again:
it gave me this error now:
Syntax error: end of file unexpected
I wrote it on windows 7 notepad++
how can I fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…