wok annotate backuppc/stuff/etc/BackupPC/shutdown.sh @ rev 20880
updated emerald and emerald-themes (0.8.12.1 -> 0.8.14)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Feb 24 17:33:44 2019 +0100 (2019-02-24) |
parents | |
children |
rev | line source |
---|---|
pascal@9282 | 1 #!/bin/sh |
pascal@9282 | 2 |
pascal@9282 | 3 # In /etc/BackupPC/config.pl: |
pascal@9282 | 4 # $Conf{DumpPostUserCmd} = '/etc/backuppc/shutdown.sh $host $xferOK'; |
pascal@9282 | 5 |
pascal@9282 | 6 ADMUSER=administrator |
pascal@9282 | 7 ADMPASS=passwdadministrator |
pascal@9282 | 8 |
pascal@9282 | 9 if [ $(date +%k) -lt 07 -o $(date +%k ) -gt 20 ]; then |
pascal@9282 | 10 /usr/bin/net rpc SHUTDOWN -f -I $1 -U $ADMUSER%$ADMPASS -t 30 |
pascal@9282 | 11 else |
pascal@9282 | 12 msg="Backup failed." |
pascal@9282 | 13 [ $2 = 1 ] && msg="Backup successful." |
pascal@9282 | 14 echo "$msg" | smbclient -M $1 --user="backuppc" |
pascal@9282 | 15 fi |