2015-05-23 16:15:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-05-23 20:21:42 +00:00
|
|
|
path=$(readlink -f $(dirname $0))
|
|
|
|
|
2015-05-23 16:15:00 +00:00
|
|
|
if [ $# -eq 1 ]
|
|
|
|
then # si 1 paramètre
|
|
|
|
case $1 in
|
2015-05-24 13:25:23 +00:00
|
|
|
'help') cat "$path/source/help"|less;;
|
2015-05-23 20:21:42 +00:00
|
|
|
'init') # initialise le contenu du fichier de config
|
|
|
|
echo "smtp_server = smtp.gmail.com" > "$path/.config"
|
|
|
|
echo "smtp_port = 587" >> "$path/.config"
|
2015-05-24 14:05:17 +00:00
|
|
|
echo "smtp_login = equal_mailadress_or_different_login" >> "$path/.config"
|
2015-05-23 20:21:42 +00:00
|
|
|
echo "mail_address = test@mail.com" >> "$path/.config"
|
|
|
|
;;
|
|
|
|
'config') nano "$path/.config";; # ouvre en modification le fichier de config
|
|
|
|
'write') nano "$path/bucket-file";; # ouvre en modification le bucket file
|
2015-05-24 13:25:23 +00:00
|
|
|
'empty') echo "">"$path/bucket-file";; # vide le bucket file
|
2015-05-23 20:21:42 +00:00
|
|
|
# ouvre en lecture le bucket file
|
|
|
|
'read') echo "\n======================================="; cat "$path/bucket-file"; echo "\n=======================================";;
|
2015-05-24 12:54:46 +00:00
|
|
|
'encode') python "$path/source/encode.py";;
|
|
|
|
'decode') python "$path/source/decode.py";;
|
|
|
|
'send') python "$path/source/send.py";;
|
2015-05-23 16:15:00 +00:00
|
|
|
*) echo "Erreur";
|
|
|
|
esac;
|
|
|
|
else
|
2015-05-24 12:54:46 +00:00
|
|
|
echo "Parametre manquant: enigmail help";
|
2015-05-23 16:15:00 +00:00
|
|
|
fi;
|