Hey guys i make alot of bash scripts on windows in notepad2 but when i upload them to my suse 10 box they all end up with this error
./newconfig: line 71: syntax error near unexpected token `done'
./newconfig: line 71: `done'
I have checked the scripts with vim and removed extra formatting but the scripts still fail, even if i copy and paste into vim
Code:
#!/bin/bash
function menuinfo {
echo Welcome to the Kings LAN gamer server config edit script
echo
echo "This script was built by Andrew James (semaja2)"
echo
echo This script will allow you to edit the configs for $1
echo with ease.
echo
echo This script is licensed under the GPL, and is only to be used for no profit
echo
echo
echo Select the menu number for the config you want to edit
}
clear
menuinfo
EDIT="plugins.ini server.cfg users.ini"
select edt in $EDIT; do
if [ "$edt" = "plugins.ini" ]; then
echo Editing plugins.ini for $1
vi /home/gserver/games/$1/addons/amxmodx/configs/plugins.ini
clear
menuinfo
if [ "$edt" = "server.cfg" ]; then
echo Editing plugins.ini for $1
vi /home/gserver/games/$1/server.cfg
clear
menuinfo
if [ "$edt" = "users.ini" ]; then
echo Editing plugins.ini for $1
vi /home/gserver/games/$1/addons/amxmodx/configs/users.ini
clear
menuinfo
else
clear
menuinfo
echo
echo
echo ERROR : BAD SELECTION, TRY AGAIN
fi
done