wok-next view backuppc/stuff/etc/BackupPC/shutdown.sh @ rev 20142

vlc: receipt v2
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 01 11:06:02 2017 +0100 (2017-11-01)
parents
children
line source
1 #!/bin/sh
3 # In /etc/BackupPC/config.pl:
4 # $Conf{DumpPostUserCmd} = '/etc/backuppc/shutdown.sh $host $xferOK';
6 ADMUSER=administrator
7 ADMPASS=passwdadministrator
9 if [ $(date +%k) -lt 07 -o $(date +%k ) -gt 20 ]; then
10 /usr/bin/net rpc SHUTDOWN -f -I $1 -U $ADMUSER%$ADMPASS -t 30
11 else
12 msg="Backup failed."
13 [ $2 = 1 ] && msg="Backup successful."
14 echo "$msg" | smbclient -M $1 --user="backuppc"
15 fi