#!/bin/sh
# On remove (not upgrade), unload the daemon and restore the default TTL of 64.
if [ "$1" = "remove" ]; then
    PLIST="/var/jb/Library/LaunchDaemons/com.kyle.pulse27.ttl65.plist"
    for lc in /var/jb/usr/bin/launchctl /usr/bin/launchctl launchctl; do
        if command -v "$lc" >/dev/null 2>&1 || [ -x "$lc" ]; then
            "$lc" unload "$PLIST" >/dev/null 2>&1
            break
        fi
    done
    echo 64 > /var/jb/etc/pulse27-ttl65.conf 2>/dev/null
fi
exit 0
