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