Results 1 to 4 of 4
I'm currently trying to execute scripts in terminal as root, when i attempt to run them the system generally requires me to use
Code:
su root ./file.sh
after changing permissions ...
- 03-13-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 3
Newbie Scripting Help
I'm currently trying to execute scripts in terminal as root, when i attempt to run them the system generally requires me to use
after changing permissions on file.sh it allows me to execute the script by simply typing:Code:su root ./file.sh
however now, the script proceeds to run another script from within the same directory. File.sh looks like thisCode:./file.sh
the console executes ./file.sh but when attempting to execute ./file_loop.sh it tells meCode:#!/bin/sh ./file_loop.sh
Please help!Code:./file.sh: line 3: ./file_loop.sh: Permission denied
- 03-13-2008 #2
- 03-13-2008 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 3
i just set the file to "allow executing as a program" but ls -l doesn't show it as -x
- 03-13-2008 #4Just Joined!
- Join Date
- Mar 2008
- Posts
- 3
okay, here's the exact scripts. at this point i don't really mind people seeing it.
startGameServer.sh
GameServer_loop.shCode:#!/bin/sh ./GameServer_loop.sh
the scripts are supposed to start a L2J emulated serverCode:#!/bin/bash # exit codes of GameServer: # 0 normal shutdown # 2 reboot attempt while :; do [ -f /L2J/gameserver/log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log" [ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log" java -Xms768m -Xmx768m -cp ./../libs/*:l2jserver.jar net.sf.l2j.gameserver.GameServer > log/stdout.log 2>&1 [ $? -ne 2 ] && break # /etc/init.d/mysql restart sleep 10 done


Reply With Quote