From: Nicolas Boisselier Date: Wed, 2 Nov 2016 21:52:09 +0000 (+0000) Subject: +mac_routes, mac_install_dmg X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=1d2cf48a39cf916c63e30323795b1233695ca6e5;p=nb.git +mac_routes, mac_install_dmg --- diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index 24a82438..efcd88c7 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -109,7 +109,11 @@ mac_install_dmg() { # NB 17.09.16 ;; # NB 17.09.16 esac local MOUNTDIR=$(echo `hdiutil mount "$1" | tail -1 | awk '{$1=$2=""; print $0}'` | xargs -0 echo) - sudo installer -verbose -pkg "${MOUNTDIR}/"*.pkg -target / + if [ -z $(ls -d1 "${MOUNTDIR}/"*.pkg 2>/dev/null) ]; then + read -p "Can not find *.pkg. Press a key to unmount ${MOUNTDIR}" + else + sudo installer -verbose -pkg "${MOUNTDIR}/"*.pkg -target / + fi sudo hdiutil detach "${MOUNTDIR}" } @@ -123,3 +127,7 @@ mac_keychain_add() { [ -n "$*" ] && in="echo $*"; eval $in | sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain } + +mac_routes() { + netstat -nr $@ | perl -pe'/^Internet6/&&last' +}