-aide dans les scripts
-update.sh (exemple)
-kymsu (mas - homebrew - pip)
This commit is contained in:
2018-02-15 17:10:05 +01:00
parent d6bec5fcfb
commit 7ea415b906
4 changed files with 72 additions and 0 deletions

View File

@@ -1,4 +1,27 @@
#!/bin/bash
if [ "$1" == "-h" ]; then
echo -e "\033[93mbackup-conf.sh\033[0m"
echo "Backup several files and folders:"
echo
echo " - httpd.conf"
echo " - httpd-vhosts.conf"
echo " - php.ini"
echo " - .bash_profile"
echo " - .gitconfig"
echo " - .wg++"
echo " - .nanorc, .nanosyntax"
echo " - .ssh"
echo " - .vnc"
echo " - .kymsu"
echo
echo "USAGE: backup-conf"
echo
echo " -h display this help"
echo
exit 0
fi
APACHE=$(httpd -v | grep "version" | awk '{print $3}' | awk -F/ '{print $2}')
PHP=$(php -v | grep "cli" | awk '{print $2}')

1
kymsu Symbolic link
View File

@@ -0,0 +1 @@
/Users/bruno/.kymsu/

View File

@@ -1,5 +1,16 @@
#!/bin/bash
if [ "$1" == "-h" ]; then
echo -e "\033[93mmkbuild.sh\033[0m"
echo "Build MkDocs project and send him on 192.168.1.7"
echo
echo "USAGE: mkbuild"
echo
echo " -h display this help"
echo
exit 0
fi
cd /Users/bruno/project
/usr/local/bin/mkdocs build
#noti -t 'MkDocs' -m 'Upload termine' scp -P42666 -r ./central_docs bruno@192.168.1.7:/volume1/web

37
update.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/sh
if [ "$1" == "-h" ]; then
echo "Colorful Homebrew update script"
echo
echo "USAGE: update [-y]"
echo
echo " -y skip questions"
echo " -h display this help"
echo
exit 0
fi
echo "\033[93mFetching packages list:\033[0m"
brew update
brewsy=`brew outdated | wc -l | awk {'print $1'}`
if [ $brewsy != 0 ]; then
echo "\033[93mOutdated packages:\033[0m" $brewsy
echo
brew outdated
echo
if [ "$1" != "-y" ]; then
ask=$(echo "\033[93mUpdate the these packages?\033[92m [y/n] \033[0m")
read -p "$ask" yn
fi
if [ "$yn" = "y" ]; then
#brew upgrade --all && brew cleanup
echo "\033[93mbrew upgrade\033[0m\n"
else
echo "\033[93mOK, not doing anything\033[0m\n"
fi
else
echo "\033[93mNothing to do\033[0m"
fi