X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=watch_subscriptions.sh;fp=watch_subscriptions.sh;h=2f807f217e0a65de48e231ca2ba070d1e3dbd89b;hb=ecd1b6f45f70a96f1d2a9f8d796af3dd37356d53;hp=0000000000000000000000000000000000000000;hpb=bb11aeed3f13b21963e3b58b767956ae751824d8;p=scripts-20-100.git diff --git a/watch_subscriptions.sh b/watch_subscriptions.sh new file mode 100755 index 0000000..2f807f2 --- /dev/null +++ b/watch_subscriptions.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Script pour vérifier que je suis bien abonné à tous mes dossiers + +# Appelé par Cron, enverra par mail le diff entre les abonnements +# et les dossiers existants + +# Appelé avec "apply" en premier paramètre, abonne à tous les dossiers présents + +MAILDIR=~/Mail + +cd $MAILDIR +diff -u <(cat subscriptions | sort) <(find . -maxdepth 1 -mindepth 1 -type d | sort | sed 's/^...//') + +if [[ "$1" = *"apply"* ]] +then + find . -maxdepth 1 -mindepth 1 -type d | sort | sed 's/^...//' > subscriptions + echo + echo "** APPLIED **" +fi