goldilocks.js/installer/install-for-launchd.sh

18 lines
514 B
Bash
Raw Normal View History

2017-11-07 00:00:25 +00:00
set -u
my_app_launchd_service="Library/LaunchDaemons/${my_app_pkg_name}.plist"
2017-11-07 00:30:14 +00:00
echo ""
echo "Installing as launchd service"
echo ""
2017-11-07 00:00:25 +00:00
2017-11-07 00:30:14 +00:00
# See http://www.launchd.info/
safe_copy_config "$my_app_dist/$my_app_launchd_service" "$my_root/$my_app_launchd_service"
$sudo_cmd chown root:wheel "$my_root/$my_app_launchd_service"
$sudo_cmd launchctl unload -w "$my_root/$my_app_launchd_service" >/dev/null 2>/dev/null
$sudo_cmd launchctl load -w "$my_root/$my_app_launchd_service"
echo "$my_app_name started with launchd"