]>
BookStack Code Mirror - devops/commitdiff
projects
/
devops
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
6b784d8
)
Added domain provided check to ubuntu install script
author
Dan Brown
<redacted>
Sat, 25 Sep 2021 19:59:00 +0000
(20:59 +0100)
committer
Dan Brown
<redacted>
Sat, 25 Sep 2021 19:59:00 +0000
(20:59 +0100)
Related to #30
scripts/installation-ubuntu-20.04.sh
patch
|
blob
|
history
diff --git
a/scripts/installation-ubuntu-20.04.sh
b/scripts/installation-ubuntu-20.04.sh
index b55f1e751e2a2ee74082e3d20c571a760414ee7d..410ade6d147aec233957377f17bdfaddc32e0059 100644
(file)
--- a/
scripts/installation-ubuntu-20.04.sh
+++ b/
scripts/installation-ubuntu-20.04.sh
@@
-12,6
+12,14
@@
printf "Enter the domain you want to host BookStack and press [ENTER]\nExamples:
read -r DOMAIN
fi
+# Ensure a domain was provided otherwise display
+# an error message and stop the script
+if [ -z "$DOMAIN" ]
+then
+ >&2 echo 'ERROR: A domain must be provided to run this script'
+ exit 1
+fi
+
# Get the current machine IP address
CURRENT_IP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')