From c0e77c7336ad5f405cf0be664caaf7ae2a59af0d Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 24 May 2019 00:31:07 -0600 Subject: [PATCH] parameters for custom service names --- backup_new.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/backup_new.sh b/backup_new.sh index 76c0e8d..de9275c 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -187,6 +187,34 @@ while [ $# -gt 0 ]; do badParam empty "$@" fi ;; + --seafile-service) + # name of seafile service + if [ -n "$2" ]; then + if ! systemctl list-unit-files | grep -Eq "^$2 |^$2.service" + then + badParam svc "$@" + else + seafService="${2}" + shift + fi + else + badParam empty "$@" + fi + ;; + --seahub-service) + # name of seahub service + if [ -n "$2" ]; then + if ! systemctl list-unit-files | grep -Eq "^$2 |^$2.service" + then + badParam svc "$@" + else + seafHub="${2}" + shift + fi + else + badParam empty "$@" + fi + ;; -o|--offline) # shutdown seafile during backup offlineBackup=1