fix: server-install.sh - an answer «n» about nginx no longer counts as nginx set up, so without nginx the server listens on every address
This commit is contained in:
1 parent
667c6177f4
commit
e0cc5a06b7
1 file changed
+8
-8
+8
-8
@@ -50,11 +50,11 @@ fi
|
||||
TTY=
|
||||
if (: </dev/tty) 2>/dev/null; then TTY=/dev/tty; fi
|
||||
|
||||
# ask VAR "question" default: the answer from the terminal, else the
|
||||
# environment's LPRA_<VAR>, else the default.
|
||||
# ask VAR "question" default [KEY]: the answer from the terminal, else the
|
||||
# environment's LPRA_<KEY> (KEY is VAR if not given), else the default.
|
||||
ask() {
|
||||
var=$1 q=$2 def=$3
|
||||
eval "env=\${LPRA_$var:-}"
|
||||
var=$1 q=$2 def=$3 key=${4:-$1}
|
||||
eval "env=\${LPRA_$key:-}"
|
||||
[ -n "$env" ] && def=$env
|
||||
ans=
|
||||
if [ -n "$TTY" ]; then
|
||||
@@ -64,11 +64,11 @@ ask() {
|
||||
[ -n "$ans" ] || ans=$def
|
||||
eval "$var=\$ans"
|
||||
}
|
||||
# confirm VAR "question" y|n: true for a yes.
|
||||
# confirm KEY "question" y|n: true for a yes (LPRA_<KEY> without a terminal).
|
||||
# The answer stays apart from the script's own variables of that name.
|
||||
confirm() {
|
||||
ask "$1" "$2 (y/n)" "$3"
|
||||
eval "v=\$$1"
|
||||
case "$v" in [yYдД]*) return 0 ;; *) return 1 ;; esac
|
||||
ask _yn "$2 (y/n)" "$3" "$1"
|
||||
case "$_yn" in [yYдД]*) return 0 ;; *) return 1 ;; esac
|
||||
}
|
||||
|
||||
# ---------- download ----------
|
||||
|
||||
Reference in new issue
Block a user