Changes

From SME Server
Jump to navigationJump to search
1,085 bytes added ,  19:11, 3 December 2013
Line 160: Line 160:  
  visudo
 
  visudo
 
And close the file. If visudo detects an error, it'll tell you. }}
 
And close the file. If visudo detects an error, it'll tell you. }}
 +
 +
as an example if you want to be able to wake on lan :
 +
  config setprop backuppc sudo `config getprop backuppc sudo`,/sbin/ether-wake
 +
signal-event backuppc-update
 +
 +
then simply add a script to your prebackup command or your ping command like :
 +
 +
 +
#!/bin/sh
 +
# Set the mac address for each host
 +
host1_mac=<mac address>
 +
host1_name=<host name>
 +
host2_mac=<mac address>
 +
host2_name=<host name>
 +
# How long does the host take to boot
 +
boottime=120
 +
# Which interface to send the WoL packets out of
 +
interface=eth0
 +
# Function to check if the host pings
 +
pingcheck()
 +
{
 +
ping -w 5 -c 2 $1
 +
export pingstatus=$?
 +
}
 +
case $1 in
 +
        host1)
 +
                sudo etherwake -i $interface $host1_mac
 +
                sleep $boottime
 +
                pingcheck $host1_name
 +
                exit $pingstatus
 +
        ;;
 +
        host2)
 +
                sudo etherwake -i $interface $host2_mac
 +
                sleep $boottime
 +
                pingcheck $host2_name
 +
                exit $pingstatus
 +
        ;;
 +
        *)
 +
                echo "Unknown machine $1"
 +
                exit 1
 +
        ;;
 +
esac
    
=== Operation ===
 
=== Operation ===
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,250

edits

Navigation menu