]> git.nbdom.net Git - nb.git/commitdiff
+mac_routes, mac_install_dmg
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 2 Nov 2016 21:52:09 +0000 (21:52 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 2 Nov 2016 21:52:09 +0000 (21:52 +0000)
etc/profile.d/mac.sh

index 24a82438598232bb9947db359f023099db0f78d2..efcd88c754f897cf64379c689d214a5669c91101 100644 (file)
@@ -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'
+}