-support de Linux
This commit is contained in:
2019-06-11 12:20:04 +02:00
parent c9a35007ac
commit adb4c0029e
2 changed files with 47 additions and 10 deletions

28
bash_tools.sh Executable file
View File

@@ -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

View File

@@ -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