#!/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 project_dir=/Users/bruno/project #exe=/usr/local/bin/ user="bruno" server="clicclac.synology.me" destination="/volume1/web" local_folder="central_docs" cd $project_dir || exit mkdocs build --clean scp -P42666 -pr ./$local_folder $user@$server:$destination #rsync -avz --stats --progress /Users/bruno/project/central_docs/ $user@$server::$dest result=$? titre="MkDocs" if [ $result -eq 0 ]; then sound="Glass" message="Envoi terminé sur $server !" else sound="Basso" message="Echec lors de l'envoi sur $server : erreur $result" fi if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v zenity)" ]; then zenity --title="$titre" --notification --text="$message" elif [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v terminal-notifier)" ]; then terminal-notifier -title "$titre" -message "$message" -sound $sound fi