aboutsummaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-08-23 22:46:36 +0200
committerKarel Kočí <cynerd@email.cz>2016-08-23 23:01:22 +0200
commit936e17a9d819a6f55bec09eafd1beec523dcaa64 (patch)
tree8dc4bafcd7453879924fb89cbe06ba6d63fdb700 /local
parentb5fdc60edacabf99dff16f04ff2c7618f2233977 (diff)
downloadmyconfigs-936e17a9d819a6f55bec09eafd1beec523dcaa64.tar.gz
myconfigs-936e17a9d819a6f55bec09eafd1beec523dcaa64.tar.bz2
myconfigs-936e17a9d819a6f55bec09eafd1beec523dcaa64.zip
Add newmail-notify and some other small tweaks
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/system-backup1
-rwxr-xr-xlocal/sbin/newmail-notify22
2 files changed, 23 insertions, 0 deletions
diff --git a/local/bin/system-backup b/local/bin/system-backup
index 18b85bc..06929c1 100755
--- a/local/bin/system-backup
+++ b/local/bin/system-backup
@@ -25,6 +25,7 @@ if [ -z "$PART" ]; then
exit -1
fi
MPATH=$(lsblk -lp | grep "$PART" | awk '{print$7}')
+# TODO check if this is not in backupped path
if [ -n "$MPATH" ]; then
echo Disk already mounted to $MPATH. Continuing with that.
else
diff --git a/local/sbin/newmail-notify b/local/sbin/newmail-notify
new file mode 100755
index 0000000..65655b4
--- /dev/null
+++ b/local/sbin/newmail-notify
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+cd ~/.mail
+
+if [ -f notify-notified ]; then
+ NOTIFIED=`cat notify-notified`
+ rm notify-notified
+fi
+
+for account in `ls`; do
+ if cd "$account"/INBOX/new; then
+ for m in `ls`; do
+ echo $m
+ echo $m >> ~/.mail/notify-notified
+ if echo "$NOTIFIED" | grep "$m" >/dev/null; then continue; fi
+ FROM=`grep -E "^From: " "$m" | sed 's/^From: //'`
+ SUBJECT=`grep -E "^Subject: " "$m" | sed 's/^Subject: //'`
+ notify-send "Email: $account" "$FROM: $SUBJECT"
+ done
+ fi
+ cd ~/.mail
+done