From 172581800e96c0318eb3e116eacdbbf6626c2f7e Mon Sep 17 00:00:00 2001 From: Andrew Beals Date: Sun, 13 Sep 2020 00:59:05 +0000 Subject: [PATCH] Make this a site-specific install for use post-testing. Require a site name. --- install.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 23e415b..6d42871 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,14 @@ user=advisorycircular if test `whoami` != root; then echo you must run this as root ; exit 1 ; fi +site="$1" + +if test -z "$site" +then + echo usage: $0 sitename + exit 1 +fi + # Create install, config, and run directories if they doesn't exist. echo Creating directories mkdir -p "$install_dir" @@ -37,7 +45,11 @@ cp out/advisorycircular.js "$install_dir"/out cp config-skel.yaml "$config_dir" cp secrets-skel.yaml "$config_dir" +cp config.yaml "$config_dir"/"$site"-config.yaml +cp secrets.yaml "$config_dir"/"$site"-secrets.yaml + cp advisorycircular@.service /lib/systemd/system +cp advisorycircular@.service /lib/systemd/system/advisorycircular@"$site".service # Download aircraft info DB. echo Downloading aircraft info database @@ -51,5 +63,10 @@ chown -R "$user" "$install_dir" chown -R "$user" "$config_dir" chown -R "$user" "$run_dir" -chmod go-r "$config_dir"/secrets-skel.yaml +chmod go-r "$config_dir"/secrets*.yaml chmod go-w "$run_dir" + +echo "Installation complete." +echo "You probably want to execute the following:" +echo "sudo systemctl enable advisorycircular@${site}.service" +echo "sudo systemctl start advisorycircular@${site}.service" \ No newline at end of file