diff --git a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-postinstall.sh b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-postinstall.sh new file mode 100755 index 0000000..a9f4617 --- /dev/null +++ b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-postinstall.sh @@ -0,0 +1,23 @@ +#! /bin/sh + +exec 2>/dev/null + +mkdir -p '/Library/Application Support/DNSCrypt/control' +mkdir -p '/Library/Application Support/DNSCrypt/dnscrypt-proxy' +mkdir -p '/Library/Application Support/DNSCrypt/probes' +mkdir -p '/Library/Application Support/DNSCrypt/states' +chown -R 0:0 '/Library/Application Support/DNSCrypt' +chmod 710 '/Library/Application Support/DNSCrypt' + +eval $(stat -s '/dev/console') || exit 1 +wanted_uid="$st_uid" +chown -R "${wanted_uid}:0" '/Library/Application Support/DNSCrypt/control' + +/bin/launchctl load -D local +/bin/launchctl start com.opendns.osx.DNSCryptConsoleChange +/bin/launchctl start com.opendns.osx.DNSCryptControlChange +/bin/launchctl start com.opendns.osx.DNSCryptNetworkChange + +touch '/Library/Application Support/DNSCrypt/control' + +exit 0 diff --git a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-preinstall.sh b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-preinstall.sh new file mode 100755 index 0000000..f127ef1 --- /dev/null +++ b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-prefpane-preinstall.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +exec 2>/dev/null + +/bin/launchctl remove com.opendns.osx.DNSCryptConsoleChange +/bin/launchctl remove com.opendns.osx.DNSCryptControlChange +/bin/launchctl remove com.opendns.osx.DNSCryptNetworkChange + +rm -f /var/run/dnscrypt*.lock + +exit 0 diff --git a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-postinstall.sh b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-postinstall.sh deleted file mode 100755 index 1415d1d..0000000 --- a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-postinstall.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -exec 2>/dev/null - -chown root:admin '/Library/Application Support/DNSCrypt Updater' -chmod 710 '/Library/Application Support/DNSCrypt Updater' -/bin/launchctl load -D local -/bin/launchctl start com.opendns.osx.DNSCryptConfigUpdater - -exit 0 diff --git a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-preinstall.sh b/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-preinstall.sh deleted file mode 100755 index edc3af1..0000000 --- a/DNSCrypt-OSX-Installer/Scripts/dnscrypt-updater-preinstall.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh - -exec 2>/dev/null - -/bin/launchctl remove com.opendns.osx.DNSCryptConfigUpdater -i=0 -while [ "$i" -lt 5 ]; do - sleep 1 - fgrep 127.0.0.1 /etc/resolv.conf > /dev/null || exit 0 - i=$((i+1)) -done -rm -f /var/run/com.opendns.osx.DNSCryptConfigUpdater/sock - -exit 0