on master help sign in
filtron.sh: add 'install rules' command

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commite6bf2038c38599a278ca110276c942e7e111d207 authorMarkus Heiser <markus.heiser@darmarit.de> dateTue 11 Feb 2020, 15:58 (7 years ago) parent0d6153d
2 files changed+18−2
utils/filtron.sh+3−1 utils/lib.sh+15−1
utils/filtron.sh+3−1
@@ -58,7 +58,7 @@ usage() {
5858usage::
5959
6060 $(basename "$0") shell
61− $(basename "$0") install [all|user]
61+ $(basename "$0") install [all|user|rules]
6262 $(basename "$0") update [filtron]
6363 $(basename "$0") remove [all]
6464 $(basename "$0") activate [service]
@@ -72,6 +72,7 @@ shell
7272install / remove
7373 :all: complete setup of filtron service
7474 :user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME)
75+ :rules: reinstall filtron rules $FILTRON_RULES
7576update filtron
7677 Update filtron installation ($SERVICE_HOME)
7778activate service
@@ -133,6 +134,7 @@ main() {
133134 rst_title "Re-Install filtron rules"
134135 echo
135136 install_template --no-eval "$FILTRON_RULES" root root 644
137+ systemd_restart_service "${SERVICE_NAME}"
136138 ;;
137139 *) usage "$_usage"; exit 42;;
138140 esac ;;
utils/lib.sh+15−1
@@ -569,7 +569,7 @@ systemd_remove_service() {
569569
570570systemd_activate_service() {
571571
572− # usage: systemd_activate_service "${SERVICE_NAME}"w
572+ # usage: systemd_activate_service "${SERVICE_NAME}"
573573
574574 rst_title "Activate ${1} (service)" section
575575 echo
@@ -594,6 +594,20 @@ systemctl disable ${1}.service
594594EOF
595595}
596596
597+systemd_restart_service() {
598+
599+ # usage: systemd_restart_service "${SERVICE_NAME}"
600+
601+ rst_title "Restart ${1} (service)" section
602+ echo
603+ tee_stderr <<EOF | bash 2>&1
604+systemctl restart ${1}.service
605+EOF
606+ tee_stderr <<EOF | bash 2>&1
607+systemctl status --no-pager ${1}.service
608+EOF
609+}
610+
597611
598612# Apache
599613# ------