From adb4c0029e38541a5582e992000be806413ca9af Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Tue, 11 Jun 2019 12:20:04 +0200 Subject: [PATCH] Mkbuild -support de Linux --- bash_tools.sh | 28 ++++++++++++++++++++++++++++ mkbuild.sh | 29 +++++++++++++++++++---------- 2 files changed, 47 insertions(+), 10 deletions(-) create mode 100755 bash_tools.sh diff --git a/bash_tools.sh b/bash_tools.sh new file mode 100755 index 0000000..dc3bc81 --- /dev/null +++ b/bash_tools.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +echo -e "\033[1mBash Tools: \033[0m" + +editeur=/usr/local/bin/bbedit + +# 1: ~/.bash_profile +# 2: ~/.bash_login +# 3: ~/.profile + +options=( + "(E)dit .bash_profile" + "(S)ource .bash_profile (reload)" + "(B)ackup .bash_profile" + "(R)estore .bash_profile" + "(Q)uit" +) + + +select option in "${options[@]}"; do + case "$REPLY" in + 1|e|E) "$editeur" ~/.bash_profile ;; + 2|s|S) source ~/.bash_profile ;; + 3|b|B) scp ~/.bash_profile funnymac@ftp.cluster011.ovh.net:www/backup ;; + 4|r|R) curl http://clicclac.info/backup/.bash_profile > ~/.bash_profile && reload ;; + 5|q|Q) break ;; + esac +done diff --git a/mkbuild.sh b/mkbuild.sh index 65adb4b..42aeeb5 100755 --- a/mkbuild.sh +++ b/mkbuild.sh @@ -11,23 +11,32 @@ if [ "$1" == "-h" ]; then 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 /Users/bruno/project || exit -/usr/local/bin/mkdocs build --clean -scp -P42666 -pr ./$local_folder $user@$server:$destination +cd $project_dir || exit +$exe/mkdocs build --clean +#scp -P42666 -pr ./$local_folder $user@$server:$destination #rsync -avz --stats --progress /Users/bruno/project/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 +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 -#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt