Add pre/postinstall scripts for the pref pane. Ditch dnscrypt-updater leftovers

This commit is contained in:
Frank Denis
2012-08-01 16:43:41 -07:00
parent a341b38ad7
commit 3de444ed8c
4 changed files with 34 additions and 24 deletions
@@ -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
@@ -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
@@ -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
@@ -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