download etc config

This commit is contained in:
AJ ONeal 2017-05-08 16:50:41 -06:00
parent 5451cbb4da
commit 1bdcd73d28
1 changed files with 17 additions and 1 deletions

View File

@ -71,6 +71,7 @@ my_app_pkg_name=com.daplie.goldilocks.web
my_app_dir=$(mktemp -d) my_app_dir=$(mktemp -d)
installer_base="https://git.daplie.com/Daplie/goldilocks.js/raw/master" 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_service="etc/systemd/system/${my_app_name}.service"
my_app_systemd_tmpfiles="etc/tmpfiles.d/${my_app_name}.conf" my_app_systemd_tmpfiles="etc/tmpfiles.d/${my_app_name}.conf"
my_app_launchd_service="Library/LaunchDaemons/${my_app_pkg_name}.plist" 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" 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_service()
{ {
install_etc_config
installable="" installable=""
if [ -d "$MY_ROOT/etc/systemd/system" ]; then if [ -d "$MY_ROOT/etc/systemd/system" ]; then
install_for_systemd 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' npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1'
# Install Service # Install Service
install_service install_service