From 733d39c2f2575704ed916396cebb0794ab6fc0dc Mon Sep 17 00:00:00 2001 From: Christopher Bowns Date: Wed, 12 Sep 2012 10:43:14 -0700 Subject: [PATCH] Properly check for, and set (if needed), the kernel flag for scoped routing. --- setup.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 53dbd3d..529b85d 100755 --- a/setup.sh +++ b/setup.sh @@ -14,10 +14,19 @@ sudo cp /etc/sysctl.conf __sysctl.conf sudo cat _sysctl.conf>>__sysctl.conf sudo cp __sysctl.conf /etc/sysctl.conf - echo 'Kernel \ - Flagsnet.inet.ip.scopedroute=0' > /Library/Preferences/SystemConfiguration/com.apple.Boot.plist +kernelflags="net.inet.ip.scopedroute=0" + +currentflags=`sudo defaults read /Library/Preferences/SystemConfiguration/com.apple.Boot "Kernel Flags"` +echo $currentflags + +if [[ "$currentflags" == "$kernelflags" ]]; then + echo "You're already set for scoped routing." +else + sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.Boot "Kernel Flags" $kernelflags + echo "To use shim, you'll need to reboot just this once for the kernel flags change to take effect." +fi + +sudo plutil -convert xml1 /Library/Preferences/SystemConfiguration/com.apple.Boot.plist ./configure_proxy.sh