From ac3f54ec6f12674d10a49333f0b778a07e6bd87e Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Sun, 4 Apr 2021 14:15:16 -0700 Subject: [PATCH] etc/vhost.conf -> bin/vhost.sh --- bin/vhost-add.sh | 4 ++-- bin/vhost-del.sh | 4 ++-- bin/vhost-deploy.sh | 4 ++-- bin/vhost-destroy.sh | 4 ++-- bin/vhost-disable.sh | 4 ++-- bin/vhost-enable.sh | 5 ++--- bin/vhost-fix-perms.sh | 5 ++--- bin/vhost-mysql-db-add.sh | 4 ++-- bin/vhost-mysql-db-del.sh | 4 ++-- bin/vhost-user-add.sh | 4 ++-- bin/vhost-user-del.sh | 4 ++-- bin/vhost-user-destroy.sh | 5 ++--- bin/vhost-user-jail-reset.sh | 4 ++-- bin/vhost-user-jail.sh | 4 ++-- bin/vhost-user-jails-cp.sh | 4 ++-- bin/vhost-user-jails-reset.sh | 4 ++-- bin/vhost-user-jails-sync.sh | 4 ++-- bin/vhost-user-jails-update.sh | 4 ++-- bin/vhost-varnish-disable.sh | 4 ++-- bin/vhost-varnish-enable.sh | 4 ++-- bin/vhost-varnish-update-sites.sh | 4 ++-- etc/vhost.conf => bin/vhost.sh | 2 ++ 22 files changed, 44 insertions(+), 45 deletions(-) rename etc/vhost.conf => bin/vhost.sh (98%) diff --git a/bin/vhost-add.sh b/bin/vhost-add.sh index 4179d5c..6fa21c4 100644 --- a/bin/vhost-add.sh +++ b/bin/vhost-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-del.sh b/bin/vhost-del.sh index 3741709..f7694ef 100644 --- a/bin/vhost-del.sh +++ b/bin/vhost-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-deploy.sh b/bin/vhost-deploy.sh index b626a6d..8f0c3ba 100644 --- a/bin/vhost-deploy.sh +++ b/bin/vhost-deploy.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # -v virtualhost (required) # -u username (optional) diff --git a/bin/vhost-destroy.sh b/bin/vhost-destroy.sh index c8bbd07..a34b873 100644 --- a/bin/vhost-destroy.sh +++ b/bin/vhost-destroy.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-disable.sh b/bin/vhost-disable.sh index bb45208..47a3bf3 100644 --- a/bin/vhost-disable.sh +++ b/bin/vhost-disable.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-enable.sh b/bin/vhost-enable.sh index f25d061..68b5ba5 100644 --- a/bin/vhost-enable.sh +++ b/bin/vhost-enable.sh @@ -4,9 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config - -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # vhost-enable.sh macro_name vhost [subdomain|alias] # vhost-enable.sh VHostHTTPS example.com diff --git a/bin/vhost-fix-perms.sh b/bin/vhost-fix-perms.sh index 376e38a..9c4aeba 100644 --- a/bin/vhost-fix-perms.sh +++ b/bin/vhost-fix-perms.sh @@ -4,9 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config - -source /etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh if [ -n "$1" ]; then if [ "$1" = '--verbose' ] || [ "$1" = '-v' ]; then diff --git a/bin/vhost-mysql-db-add.sh b/bin/vhost-mysql-db-add.sh index 190e95d..ecf7772 100644 --- a/bin/vhost-mysql-db-add.sh +++ b/bin/vhost-mysql-db-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-mysql-db-del.sh b/bin/vhost-mysql-db-del.sh index bc3c46d..fa55d2f 100644 --- a/bin/vhost-mysql-db-del.sh +++ b/bin/vhost-mysql-db-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # # check for and set virtualhost # if [ -n "$1" ]; then diff --git a/bin/vhost-user-add.sh b/bin/vhost-user-add.sh index 214060f..8041e24 100644 --- a/bin/vhost-user-add.sh +++ b/bin/vhost-user-add.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set username if [ -n "$1" ]; then diff --git a/bin/vhost-user-del.sh b/bin/vhost-user-del.sh index c9c7d90..6229d24 100644 --- a/bin/vhost-user-del.sh +++ b/bin/vhost-user-del.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set username if [ -n "$1" ]; then diff --git a/bin/vhost-user-destroy.sh b/bin/vhost-user-destroy.sh index b972dc8..223c47f 100644 --- a/bin/vhost-user-destroy.sh +++ b/bin/vhost-user-destroy.sh @@ -4,9 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit - +# load include file +source $(dirname $0)/vhost.sh # check for and set username if [ -n "$1" ]; then diff --git a/bin/vhost-user-jail-reset.sh b/bin/vhost-user-jail-reset.sh index fe0602e..e92f2f9 100644 --- a/bin/vhost-user-jail-reset.sh +++ b/bin/vhost-user-jail-reset.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set username if [ -n "$1" ]; then diff --git a/bin/vhost-user-jail.sh b/bin/vhost-user-jail.sh index 6c263a1..cb1210d 100644 --- a/bin/vhost-user-jail.sh +++ b/bin/vhost-user-jail.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set username if [ -n "$1" ]; then diff --git a/bin/vhost-user-jails-cp.sh b/bin/vhost-user-jails-cp.sh index 2e1928a..03a3883 100644 --- a/bin/vhost-user-jails-cp.sh +++ b/bin/vhost-user-jails-cp.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set file to be copied in to jails if [ -n "$1" ]; then diff --git a/bin/vhost-user-jails-reset.sh b/bin/vhost-user-jails-reset.sh index bc9254a..2a15d93 100644 --- a/bin/vhost-user-jails-reset.sh +++ b/bin/vhost-user-jails-reset.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # make sure jails dir exists if [[ ! -e /usr/jails/ ]]; then diff --git a/bin/vhost-user-jails-sync.sh b/bin/vhost-user-jails-sync.sh index 9b200a4..5050db9 100644 --- a/bin/vhost-user-jails-sync.sh +++ b/bin/vhost-user-jails-sync.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh mode=q diff --git a/bin/vhost-user-jails-update.sh b/bin/vhost-user-jails-update.sh index e668607..81213c2 100644 --- a/bin/vhost-user-jails-update.sh +++ b/bin/vhost-user-jails-update.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # make sure jails dir exists if [[ ! -e /usr/jails/ ]]; then diff --git a/bin/vhost-varnish-disable.sh b/bin/vhost-varnish-disable.sh index 288ac22..e226083 100644 --- a/bin/vhost-varnish-disable.sh +++ b/bin/vhost-varnish-disable.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # varnish-disable.sh virtualhost diff --git a/bin/vhost-varnish-enable.sh b/bin/vhost-varnish-enable.sh index fab3f8c..01f7d12 100644 --- a/bin/vhost-varnish-enable.sh +++ b/bin/vhost-varnish-enable.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh # check for and set virtualhost if [ -n "$1" ]; then diff --git a/bin/vhost-varnish-update-sites.sh b/bin/vhost-varnish-update-sites.sh index 669ce98..e8cd209 100644 --- a/bin/vhost-varnish-update-sites.sh +++ b/bin/vhost-varnish-update-sites.sh @@ -4,8 +4,8 @@ # https://git.stack-source.com/msb/vhost-stack # MIT License Copyright (c) 2021 Matthew Saunders Brown -# load config -source /usr/local/etc/vhost.conf || echo "ERROR: Either you do not have vhost user permissions or the config file is missing." && exit +# load include file +source $(dirname $0)/vhost.sh if [ ! -f /etc/varnish/sites.d/example.com.vcl ]; then diff --git a/etc/vhost.conf b/bin/vhost.sh similarity index 98% rename from etc/vhost.conf rename to bin/vhost.sh index ac24833..74f7f2d 100644 --- a/etc/vhost.conf +++ b/bin/vhost.sh @@ -1,3 +1,5 @@ +#!/bin/bash +# # vhost configs # any script that includes this conf file will force user to be root