-ajout notification -variables $server,$user et $destination pour la commande scp
31 lines
770 B
Bash
Executable File
31 lines
770 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$1" == "-h" ]; then
|
|
echo -e "\033[93mmkbuild.sh\033[0m"
|
|
echo "Build MkDocs project and send him on server"
|
|
echo
|
|
echo "USAGE: mkbuild"
|
|
echo
|
|
echo " -h display this help"
|
|
echo
|
|
exit 0
|
|
fi
|
|
|
|
user="bruno"
|
|
server="clicclac.synology.me"
|
|
destination="/volume1/web"
|
|
|
|
cd /Users/bruno/project
|
|
/usr/local/bin/mkdocs build
|
|
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
|