[sudo-users] Code:

Benjamin Johann b.johann at web.de
Mon Sep 13 09:52:52 EDT 2004


Thanks for the idea to use cat. I will try it out tomorrow evening. Here 
is the code i am using. (maybe not exact)

PHP:
if $command == "verbinden"
    passthru("echo 1 > /tmp/$_SERVER[REMOTE_IP]");

if $command == "trennen"
    passthru("echo 0 > /tmp/$_SERVER[REMOTE_IP]");

passthru("sudo /usr/bin/online.sh");




SCRIPT /usr/bin/online.sh:
#!/bin/bash
$andre='more /tmp/192.168.0.1'
$roman='more /tmp/192.168.0.2'

if [ $roman = "0" ] ; then
echo "Roman ist offline"
else
echo "Roman ist online"
fi

if [ $andre = "0" ] ; then
echo "Andre ist offline"
else
echo "Andre ist online"
fi

if [ $andre = "0"] ||[$roman = "0" ] ; then
gooffline
else
goonline
fi


Ben





More information about the sudo-users mailing list