#!/bin/bash [ "$(sudo whoami)" == "root" ] || exit 1 targetService="com.sysctl.ttl.plist" cat < "/tmp/$targetService" EnvironmentVariables PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: Label com.sysctl.ttl ProgramArguments sysctl -w net.inet.ip.ttl=96 RunAtLoad KeepAlive LaunchOnlyOnce EOF sudo cp -rf "/tmp/$targetService" "/Library/LaunchDaemons/$targetService" sudo chown root:wheel "/Library/LaunchDaemons/$targetService" sudo chmod 644 "/Library/LaunchDaemons/$targetService" sudo launchctl load -w "/Library/LaunchDaemons/$targetService" exit 0