sudo and at commands
ok i have the follwoing two lines below that are executed from a php script on my webserver
this line matches the ip address with the mac address of a users and enters this information in to the ip tables echo exec("sudo arp | grep $REMOTE_ADDR | awk '{print $1}'| /root/user/www/cgi-bin/change"); this one does the opposite EXCEPT there is a time delay of 24 hours (i want the script to execute then) echo exec("sudo at now + 24 hours | sudo arp | grep $REMOTE_ADDR | awk '{print $1}'| /root/user/www/cgi-bin/rem"); this is the one im having trouble with it works without the "sudo at now + 24 hours" it seems ok that there is a job waiting when i type atq to see the jobs in the queue but they dont execute at all properly must be the order in which it appears or something any ideas? would cron do the trick! |
Quote:
Then make an entry for the script in /etc/sudoers And execute: echo "sudo /usr/local/sbin/arpcheck.sh" | at now + 24 hours |
but who could i pass the ip address variable to the script!?
I think thats where the main problem lies |
All times are GMT -5. The time now is 04:07 PM. |