set all variables properly and create paths correctly

This commit is contained in:
AJ ONeal 2017-05-08 21:56:40 +00:00
parent d71240a222
commit 569e3b02d2
1 changed files with 11 additions and 8 deletions

View File

@ -80,15 +80,17 @@ install_for_systemd()
echo "" echo ""
echo "Installing as systemd service" echo "Installing as systemd service"
echo "" echo ""
dap_dl "$installer_base/$my_app_system_service" "$my_app_dir/$my_app_system_service" mkdir -p $(dirname "$my_app_dir/$my_app_systemd_service")
$sudo_cmd mv "$my_app_dir/$my_app_system_service" "$MY_ROOT/$my_app_system_service" dap_dl "$installer_base/$my_app_systemd_service" "$my_app_dir/$my_app_systemd_service"
$sudo_cmd chown -R root:root "$MY_ROOT/$my_app_system_service" $sudo_cmd mv "$my_app_dir/$my_app_systemd_service" "$MY_ROOT/$my_app_systemd_service"
$sudo_cmd chmod 644 "$MY_ROOT/$my_app_system_service" $sudo_cmd chown -R root:root "$MY_ROOT/$my_app_systemd_service"
$sudo_cmd chmod 644 "$MY_ROOT/$my_app_systemd_service"
dap_dl "$installer_base/$my_app_system_tmpfiles" "$my_app_dir/$my_app_system_tmpfiles" mkdir -p $(dirname "$my_app_dir/$my_app_systemd_tmpfiles")
$sudo_cmd mv "$my_app_dir/$my_app_system_tmpfiles" "$MY_ROOT/$my_app_system_tmpfiles" dap_dl "$installer_base/$my_app_systemd_tmpfiles" "$my_app_dir/$my_app_systemd_tmpfiles"
$sudo_cmd chown -R root:root "$MY_ROOT/$my_app_system_tmpfiles" $sudo_cmd mv "$my_app_dir/$my_app_systemd_tmpfiles" "$MY_ROOT/$my_app_systemd_tmpfiles"
$sudo_cmd chmod 644 "$MY_ROOT/$my_app_system_tmpfiles" $sudo_cmd chown -R root:root "$MY_ROOT/$my_app_systemd_tmpfiles"
$sudo_cmd chmod 644 "$MY_ROOT/$my_app_systemd_tmpfiles"
$sudo_cmd systemctl stop "${my_app_name}.service" >/dev/null 2>/dev/null $sudo_cmd systemctl stop "${my_app_name}.service" >/dev/null 2>/dev/null
$sudo_cmd systemctl daemon-reload $sudo_cmd systemctl daemon-reload
@ -104,6 +106,7 @@ install_for_launchd()
echo "Installing as launchd service" echo "Installing as launchd service"
echo "" echo ""
# See http://www.launchd.info/ # See http://www.launchd.info/
mkdir -p $(dirname "$my_app_dir/$my_app_launchd_service")
dap_dl "$installer_base/$my_app_launchd_service" "$my_app_dir/$my_app_launchd_service" dap_dl "$installer_base/$my_app_launchd_service" "$my_app_dir/$my_app_launchd_service"
$sudo_cmd mv "$my_app_dir/$my_app_launchd_service" "$MY_ROOT/$my_app_launchd_service" $sudo_cmd mv "$my_app_dir/$my_app_launchd_service" "$MY_ROOT/$my_app_launchd_service"
$sudo_cmd chown root:wheel "$MY_ROOT/$my_app_launchd_service" $sudo_cmd chown root:wheel "$MY_ROOT/$my_app_launchd_service"