Mkbuild
-support de Linux
This commit is contained in:
28
bash_tools.sh
Executable file
28
bash_tools.sh
Executable 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
|
||||||
29
mkbuild.sh
29
mkbuild.sh
@@ -11,23 +11,32 @@ if [ "$1" == "-h" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
project_dir=/Users/bruno/project
|
||||||
|
exe=/usr/local/bin/
|
||||||
|
|
||||||
user="bruno"
|
user="bruno"
|
||||||
server="clicclac.synology.me"
|
server="clicclac.synology.me"
|
||||||
destination="/volume1/web"
|
destination="/volume1/web"
|
||||||
local_folder="central_docs"
|
local_folder="central_docs"
|
||||||
|
|
||||||
cd /Users/bruno/project || exit
|
cd $project_dir || exit
|
||||||
/usr/local/bin/mkdocs build --clean
|
$exe/mkdocs build --clean
|
||||||
scp -P42666 -pr ./$local_folder $user@$server:$destination
|
#scp -P42666 -pr ./$local_folder $user@$server:$destination
|
||||||
#rsync -avz --stats --progress /Users/bruno/project/central_docs/ $user@$server::$dest
|
#rsync -avz --stats --progress /Users/bruno/project/central_docs/ $user@$server::$dest
|
||||||
|
|
||||||
result=$?
|
result=$?
|
||||||
|
|
||||||
if [ -x "$(command -v terminal-notifier)" ]; then
|
titre="MkDocs"
|
||||||
if [ $result -eq 0 ]; then
|
if [ $result -eq 0 ]; then
|
||||||
terminal-notifier -title 'MkDocs' -message "Envoi terminé sur $server !" -sound 'Glass'
|
sound="Glass"
|
||||||
else
|
message="Envoi terminé sur $server !"
|
||||||
terminal-notifier -title 'MkDocs' -message "Echec lors de l'envoi sur $server : erreur $result" -sound 'Basso'
|
else
|
||||||
fi
|
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
|
fi
|
||||||
#rsync -rav -e ssh ./central_docs bruno@192.168.1.7:/volume1/web/tt
|
|
||||||
|
|||||||
Reference in New Issue
Block a user