mkbuild.sh

-ajout notification
-variables $server,$user et $destination pour la commande scp
This commit is contained in:
2018-07-31 20:05:12 +02:00
parent db70d8f8d0
commit 9d532b6602

View File

@@ -2,7 +2,7 @@
if [ "$1" == "-h" ]; then
echo -e "\033[93mmkbuild.sh\033[0m"
echo "Build MkDocs project and send him on 192.168.1.7"
echo "Build MkDocs project and send him on server"
echo
echo "USAGE: mkbuild"
echo
@@ -11,10 +11,20 @@ if [ "$1" == "-h" ]; then
exit 0
fi
user="bruno"
server="clicclac.synology.me"
destination="/volume1/web"
cd /Users/bruno/project
/usr/local/bin/mkdocs build
#noti -t 'MkDocs' -m 'Upload termine' scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web
scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web
terminal-notifier -title 'MkDocs' -message 'Envoi terminé !' -sound 'Glass'
#scp -P42666 -r ./central_docs bruno@clicclac.synology.me:/volume1/web
scp -P42666 -r ./central_docs $user@$server:$dest
result=$?
if [ -x "$(command -v terminal-notifier)" ]; then
if [ $result -eq 0 ]; then
terminal-notifier -title 'MkDocs' -message "Envoi terminé sur $server !" -sound 'Glass'
else
terminal-notifier -title 'MkDocs' -message "Echec lors de l'envoi sur $server : erreur $result" -sound 'Basso'
fi
fi
#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt