From db978efa3157e14fd5bd359a1ebdf153d90c4dbe Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 8 Nov 2016 21:15:41 +0000 Subject: [PATCH] mac_install --- etc/profile.d/mac.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index c4f0706d..f6b900a3 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -1,5 +1,4 @@ # See: http://www.infoworld.com/article/2614879/mac-os-x/top-20-os-x-command-line-secrets-for-power-users.html - mac_pbcopy() { local host="$1"; shift cat $@ | ssh -q $host -o 'ForwardAgent yes' 'cat|pbcopy' @@ -8,12 +7,9 @@ mac_pbcopy() { ############################################################################## # # Darwin only ! +case "$OSTYPE" in darwin*) # ############################################################################## -case "$OSTYPE" in - darwin*) [ 1 ];; - *) return ;; -esac [ -x /opt/local/bin/mysqld_safe5 ] && alias mac_mysqlstart='sudo /opt/local/bin/mysqld_safe5 &' [ -x /opt/local/bin/mysqladmin5 ] && alias mac_mysqlstop='sudo /opt/local/bin/mysqladmin5 -u root -p shutdown' [ -x /Applications/iTunes.app/Contents/MacOS/iTunes ] && alias iTunes=/Applications/iTunes.app/Contents/MacOS/iTunes @@ -108,7 +104,7 @@ mac_install() { # Install case "$prg" in - ""|-h|--help) exec echo "Usage: $FUNCNAME [docker|virtualbox|DMG|PKG]" ;; + ""|-h|--help) echo "Usage: $FUNCNAME [docker|virtualbox|DMG|PKG]"; return ;; *.pkg) udo installer -verbose -pkg "$prg" -target / ;; *) local MOUNTDIR=$(echo `sudo hdiutil mount "$prg" | tail -1 | awk '{$1=$2=""; print $0}'` | xargs -0 echo) @@ -141,3 +137,5 @@ mac_keychain_add() { mac_routes() { netstat -nr $@ | perl -pe'/^Internet6/&&last' } + +;;esac # Darwin only ! <<< -- 2.47.3