added require root

This commit is contained in:
Matthew Saunders Brown 2021-01-25 13:39:05 -08:00
parent ab721feae4
commit 0d26eef610
7 changed files with 42 additions and 0 deletions

View File

@ -19,6 +19,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
if [ ! -d $backup_storage_dir ]; then
echo "ERROR: Backup storage dir ($backup_storage_dir) does not exist."
exit 1

View File

@ -21,6 +21,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
if [ ! -d $backup_storage_dir ]; then
echo "ERROR: Backup storage dir ($backup_storage_dir) does not exist."
exit 1

View File

@ -17,6 +17,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
if [ ! -d $backup_storage_dir ]; then
echo "ERROR: Backup storage dir ($backup_storage_dir) does not exist."
exit 1

View File

@ -14,6 +14,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
help()
{
thisfilename=$(basename -- "$0")

View File

@ -14,6 +14,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
help()
{
thisfilename=$(basename -- "$0")

View File

@ -14,6 +14,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
help()
{
thisfilename=$(basename -- "$0")

View File

@ -12,6 +12,12 @@ if [[ -f /usr/local/etc/bashup.cnf ]]; then
source /usr/local/etc/bashup.cnf
fi
# require root
if [ "${EUID}" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
help()
{
thisfilename=$(basename -- "$0")