From 1d2cf48a39cf916c63e30323795b1233695ca6e5 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 2 Nov 2016 21:52:09 +0000 Subject: [PATCH] +mac_routes, mac_install_dmg --- etc/profile.d/mac.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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' +} -- 2.47.3