restart services

This commit is contained in:
AJ ONeal 2017-04-20 18:22:16 -06:00
parent 0a39624d4d
commit 879b0d05a0
1 changed files with 8 additions and 0 deletions

View File

@ -376,8 +376,12 @@ CADDY_EOF
$sudo_cmd chown -R root:root $PREFIX/etc/tmpfiles.d/caddy.conf
$sudo_cmd chmod 644 $PREFIX/etc/tmpfiles.d/caddy.conf
$sudo_cmd systemctl stop caddy.service >/dev/null 2>/dev/null
$sudo_cmd systemctl daemon-reload
$sudo_cmd systemctl start caddy.service
echo "caddy started with systemctl"
elif [ -d "/Library/LaunchAgents" ]; then
echo ""
echo "Installing as launchd service"
@ -387,7 +391,11 @@ CADDY_EOF
$sudo_cmd mv $PREFIX/tmp/$caddy_dir/com.caddyserver.web.plist /Library/LaunchAgents/com.caddyserver.web.plist
$sudo_cmd chown root:wheel /Library/LaunchAgents/com.caddyserver.web.plist
$sudo_cmd chmod 0644 /Library/LaunchAgents/com.caddyserver.web.plist
$sudo_cmd launchctl unload -w /Library/LaunchAgents/com.caddyserver.web.plist >/dev/null 2>/dev/null
$sudo_cmd launchctl load -w /Library/LaunchAgents/com.caddyserver.web.plist
echo "caddy started with launchd"
echo ""
echo "Unknown system service init type. You must install as a system service manually."