notify.sh - > !admin


(BlackEight) #1

Hi
Ive got a prob with LOCKDIR…i think i set it wrong but am not sure.

#!/bin/sh

LOCKFILE=notify.lock
LOCKDIR=var
#LOCKDIR=/usr/local/games/enemy_territory/etadmin_mod/tools/locks

Lock this script at least 30 minutes

LOCK=find $LOCKDIR/ -cmin -30 -name $LOCKFILE

if ( test -z “$LOCK” ) then
# OK
touch $LOCKDIR/$LOCKFILE

I dont know what to put in there. I tired to use that /etadmin_mod/tools/locks but ive got no tools or lock folders along with the etadmin_mod. I rent the game server so usually my dirs look like …/nq/ or …/etadmin_mod/ but what is that LOCKDIR for? Is that some place where !admin will be stored? When i check the etadmin log i got Permission denied info.


(ailmanki) #2

that lockfile is probably there so that one can’t abuse the cmd to spam your email…

What it does is create a file in tools/locks, and if that file is less than 30mins old, it probably does nothing.
So if that folder is missing, it cannot create it, and that is why it probably gets permission denied. Check that the LOCKDIR can be written by the user which runs etadmin mod, in your case I see now, LOCKDIR is set to ‘var’…
So probably the user has no rights to write in /etadmin_mod/var … or wherever that ‘var’ would be… better use absolute filepath.


(BlackEight) #3

I think i now what you mean. Its like certain adminlevel has no right to use that command. But is set every user to have it.
Anyway, what do you mean by absolute path?


(ailmanki) #4

(valkyr) #5

You just need to give the /etadmin_mod/var directory write permissions.

If you have SSH access do


chmod +w var

from the etadmin_mod directory.

Or you can change permissions with some FTP clients.


(BlackEight) #6

Thank you for your feedback.
Ill check it out and present results.

Cheers


(BlackEight) #7

Yes, it was a matter of that file permissions.
I used WS FTP program to give notify.sh all read,rewrite etc permisssions.

Thank you to help me.

Kind regards,
Black