Created
July 18, 2013 16:31
-
-
Save umrysh/6030771 to your computer and use it in GitHub Desktop.
To alleviate paranoia run this script every minute through your crontab and you will get an alert if unknown IPs are connecting to your Bittorent Sync folders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
###################################################################################### | |
# The location of your Bittorent Sync log | |
LOG_LOCATION="/home/user/.btsync/btsync/sync.log" | |
# The list of known IPs you do not require an alert about | |
KNOWN_IPS="192.168.1|69.147.76.15|216.239.51.9" | |
# The icon for your alert | |
# I found a great little image here: | |
# http://i1-win.softpedia-static.com/screenshots/icon-60/BitTorrent-Sync.png | |
ALERT_IMAGE="/home/user/bin/BitTorrent-Sync.png" | |
###################################################################################### | |
cat $LOG_LOCATION | grep Incoming | cut -d ' ' -f6 | cut -d ':' -f1 | grep -Ev $KNOWN_IPS | sort -u | while read ALERT_OUT; do DISPLAY=:0.0 XAUTHORITY=~/.Xauthority notify-send -i $ALERT_IMAGE -t 5000 --hint=int:transient:1 -- 'Unknown BTsync Connection' "$ALERT_OUT";done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If after a while you start getting alerts about an unknown connection but the pop-up shows no other information you will need to delete your "sync.log" file and restart BitTorrent Sync.