#!/bin/bash

WINEXE=/usr/bin/winexe

if [ ! -z $2 ]; then
    UNAME=$2
fi
if [ ! -z $3 ]; then
    PASS=$3
fi

BOX=$1

if [[ ! -z $UNAME && ! -z $PASS ]]; then
    $WINEXE -s /dev/null -U $UNAME --password=$PASS //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
else
    $WINEXE -s /dev/null --authentication-file=/etc/BackupPC/win.conf //$BOX 'cmd /c echo '1' > c:\backuppc\wake.up' <&-
fi
echo "Rsync and shadow copy unloaded"
