From: Kenneth <me...@ho...> - 2011-08-29 09:53:15
|
Hello, I'd like to shutdown my linux workstation after a dump, but it shouldn't shutdown the workstation when a user is still logged in. However, my scripts do not seem to work when called from backuppc. However, it works when I call wrapper.sh from the shell by entering ./wrapper.sh "HOSTNAME" as user backuppc. Any ideas how to solve this? Thanks, Ken config exerpt: $Conf{DumpPostUserCmd} = 'wrapper.sh $host'; wrapper.sh contains: HOSTNAME=$1 ssh root@$HOSTNAME 'bash' < /etc/backuppc/shutdown.sh shutdown.sh contains: #!/bin/bash # Read logged users USERCOUNT=`who | wc -l`; # No Shutdown if there are any users logged in if (($USERCOUNT>0)) then exit else shutdown -h now fi exit 0 |