From 1bdcd73d28974ebccea8e62734105065e932bb38 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 8 May 2017 16:50:41 -0600 Subject: [PATCH] download etc config --- install.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index d6db1b6..78759e3 100644 --- a/install.sh +++ b/install.sh @@ -71,6 +71,7 @@ my_app_pkg_name=com.daplie.goldilocks.web my_app_dir=$(mktemp -d) installer_base="https://git.daplie.com/Daplie/goldilocks.js/raw/master" +my_app_etc_config="etc/${my_app_name}/${my_app_name}.yml" my_app_systemd_service="etc/systemd/system/${my_app_name}.service" my_app_systemd_tmpfiles="etc/tmpfiles.d/${my_app_name}.conf" my_app_launchd_service="Library/LaunchDaemons/${my_app_pkg_name}.plist" @@ -117,8 +118,23 @@ install_for_launchd() echo "$my_app_name started with launchd" } +install_etc_config() +{ + if [ ! -e "$MY_ROOT/$my_app_etc_config" ]; then + mkdir -p $(basename "$MY_ROOT/$my_app_etc_config") + dap_dl "$installer_base/$my_app_etc_config" "$my_app_dir/$my_app_etc_config" + $sudo_cmd mv "$my_app_dir/$my_app_etc_config" "$MY_ROOT/$my_app_etc_config" + fi + + $sudo_cmd chown -R www-data:www-data $(basename "$MY_ROOT/$my_app_etc_config") + $sudo_cmd chmod 775 $(basename "$MY_ROOT/$my_app_etc_config") + $sudo_cmd chmod 664 "$MY_ROOT/$my_app_etc_config" +} + install_service() { + install_etc_config + installable="" if [ -d "$MY_ROOT/etc/systemd/system" ]; then install_for_systemd @@ -150,4 +166,4 @@ dap_dl_bash "https://git.daplie.com/coolaj86/node-install-script/raw/master/setu npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' # Install Service -install_service \ No newline at end of file +install_service