diff --git a/bin/vmail-aliases-add.sh b/bin/vmail-aliases-add.sh index c9d821b..8776128 100755 --- a/bin/vmail-aliases-add.sh +++ b/bin/vmail-aliases-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-aliases-del.sh b/bin/vmail-aliases-del.sh index dd22342..be429c0 100755 --- a/bin/vmail-aliases-del.sh +++ b/bin/vmail-aliases-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-aliases-get.sh b/bin/vmail-aliases-get.sh index 3a5daef..55b9095 100755 --- a/bin/vmail-aliases-get.sh +++ b/bin/vmail-aliases-get.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-deploy.sh b/bin/vmail-deploy.sh index eed2930..f8f9be6 100755 --- a/bin/vmail-deploy.sh +++ b/bin/vmail-deploy.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vmail-dkim-add.sh b/bin/vmail-dkim-add.sh index 242dff0..e0a7459 100755 --- a/bin/vmail-dkim-add.sh +++ b/bin/vmail-dkim-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vmail-dkim-del.sh b/bin/vmail-dkim-del.sh index fa4064b..bd751f1 100755 --- a/bin/vmail-dkim-del.sh +++ b/bin/vmail-dkim-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vmail-domains-add.sh b/bin/vmail-domains-add.sh index 7f790be..02767f7 100755 --- a/bin/vmail-domains-add.sh +++ b/bin/vmail-domains-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-domains-del.sh b/bin/vmail-domains-del.sh index 7077675..17435b1 100755 --- a/bin/vmail-domains-del.sh +++ b/bin/vmail-domains-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-domains-get.sh b/bin/vmail-domains-get.sh index 5c2671c..f4b5244 100755 --- a/bin/vmail-domains-get.sh +++ b/bin/vmail-domains-get.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-domains-mod.sh b/bin/vmail-domains-mod.sh index 0190586..c50ee59 100755 --- a/bin/vmail-domains-mod.sh +++ b/bin/vmail-domains-mod.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-forwards-add.sh b/bin/vmail-forwards-add.sh index 9542b6a..8c926a7 100755 --- a/bin/vmail-forwards-add.sh +++ b/bin/vmail-forwards-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-forwards-del.sh b/bin/vmail-forwards-del.sh index 5bfbf6b..ad4334a 100755 --- a/bin/vmail-forwards-del.sh +++ b/bin/vmail-forwards-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-forwards-get.sh b/bin/vmail-forwards-get.sh index 9398de4..30869b1 100755 --- a/bin/vmail-forwards-get.sh +++ b/bin/vmail-forwards-get.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-mboxes-add.sh b/bin/vmail-mboxes-add.sh index 8f9e3ac..f3e586a 100755 --- a/bin/vmail-mboxes-add.sh +++ b/bin/vmail-mboxes-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-mboxes-del.sh b/bin/vmail-mboxes-del.sh index a86ae4c..cda71c1 100755 --- a/bin/vmail-mboxes-del.sh +++ b/bin/vmail-mboxes-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-mboxes-get.sh b/bin/vmail-mboxes-get.sh index 24be9bd..e64898b 100755 --- a/bin/vmail-mboxes-get.sh +++ b/bin/vmail-mboxes-get.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh help() { diff --git a/bin/vmail-purge-dirs.sh b/bin/vmail-purge-dirs.sh index 0525caf..3cc61f3 100755 --- a/bin/vmail-purge-dirs.sh +++ b/bin/vmail-purge-dirs.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vmail-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vmail.conf || echo "ERROR: Either you do not have vmail user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vmail.sh # only continue if vmail dir exists if [ -d $VMAIL_DIR ]; then diff --git a/etc/vmail.conf b/bin/vmail.sh old mode 100644 new mode 100755 similarity index 88% rename from etc/vmail.conf rename to bin/vmail.sh index a2a98a8..07f6520 --- a/etc/vmail.conf +++ b/bin/vmail.sh @@ -1,4 +1,10 @@ -# vmail configs +#!/bin/bash +# +# vmail-stack +# https://git.stack-source.com/msb/vmail-stack +# MIT License Copyright (c) 2021 Matthew Saunders Brown +# +# vmail include file, used by other vmail bash scripts # any script that includes this conf file will force user to be vmail if [ "$USER" != "vmail" ]; then