Ubuntu Pastebin

Paste from ioria at Fri, 29 Sep 2017 18:38:45 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
rm winfile* 2> /dev/null
(
while :
 do smbclient //pc-name/shared-folder-name -c "dir " -U=user%password > winfiles 2> /dev/null && awk '{print $1}' winfiles| sed  '$ d'  > winfiles1

sleep 8
done
)&

sleep 2 
while : 
do
cp winfiles1  winfiles2
sleep 1
diff winfiles1 winfiles2   > /dev/null 2>&1
error=$?
if [ $error -eq 1 ]
then
   notify-send "$(echo the folder changed)"
fi
done
Download as text