Created
November 5, 2011 23:41
-
-
Save ashfame/1342206 to your computer and use it in GitHub Desktop.
Shutdown linux (Ubuntu) when Dropbox completes transfer
This file contains 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/bash | |
# By Ashfame | |
while true | |
do | |
# keep checking for idle dropbox status | |
STATUS=`dropbox status` | |
if [ $STATUS = 'Idle' ]; then | |
notify-send "System Shutdown" "System will power off now" | |
sleep 10 | |
shutdown -P | |
exit | |
fi | |
# wait for 10 secs for the next check (iteration) | |
sleep 10 | |
done | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used your script for my own purpose. To shutdown keepass(xc) gracefully so it'll ask if I have unsaved entries and then wait for dropbox to sync.
NOTE: On my Dropbox installation the correct state was
Up to date
and notIdle
.Script:
Example Output:
Desktop file:
deepin-terminal
should of course be changed to whatever your terminal is.