LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script problem changing directories (https://www.linuxquestions.org/questions/linux-newbie-8/script-problem-changing-directories-170513/)

richie72 04-15-2004 10:20 AM

script problem changing directories
 
ok heres the issue i have set up a remote linux server which i have installed medal of hour games on

and i have wrote a script to start the servers ruuning

the only problem is this

script

#!/bin/sh

cd /home/servers

screen -dmS server1 ./mohaa_lnxded

it falls down on first part as it is not changing dir like i am telling it to

i have chmodded this file to 755 so i can run it also the dir are chmodded to 777

the server is running red hat

is there another way of doing this or is there somethink missing from the server install that stops this script from running

i know the game server works as if i change into the dir i can type in the

screen -dmS server1 ./mohaa_lnxded

and the server starts up

please help as head hurting from hitting head against solid object

druuna 04-15-2004 11:20 AM

Try using set -x to check which lines of your script are run and which are not ('debugging').

Code:

#!/bin/sh
set -x
cd /home/servers
screen -dmS server1 ./mohaa_lnxded

PS: Don't open your box more then is needed. I hope you changed the permissions of ../servers/ to 777, not /home. Even 777 for servers is probably to open, 755 should do.

ugge 04-15-2004 11:21 AM

Where do you run this script from?
From a web script or manually as a logged in user?

richie72 04-15-2004 03:25 PM

i run it from being a logged in user

like this ./start.sh


All times are GMT -5. The time now is 12:01 PM.