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=
|
TTY=
|
||||||
if (: </dev/tty) 2>/dev/null; then TTY=/dev/tty; fi
|
if (: </dev/tty) 2>/dev/null; then TTY=/dev/tty; fi
|
||||||
|
|
||||||
# ask VAR "question" default: the answer from the terminal, else the
|
# ask VAR "question" default [KEY]: the answer from the terminal, else the
|
||||||
# environment's LPRA_<VAR>, else the default.
|
# environment's LPRA_<KEY> (KEY is VAR if not given), else the default.
|
||||||
ask() {
|
ask() {
|
||||||
var=$1 q=$2 def=$3
|
var=$1 q=$2 def=$3 key=${4:-$1}
|
||||||
eval "env=\${LPRA_$var:-}"
|
eval "env=\${LPRA_$key:-}"
|
||||||
[ -n "$env" ] && def=$env
|
[ -n "$env" ] && def=$env
|
||||||
ans=
|
ans=
|
||||||
if [ -n "$TTY" ]; then
|
if [ -n "$TTY" ]; then
|
||||||
@@ -64,11 +64,11 @@ ask() {
|
|||||||
[ -n "$ans" ] || ans=$def
|
[ -n "$ans" ] || ans=$def
|
||||||
eval "$var=\$ans"
|
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() {
|
confirm() {
|
||||||
ask "$1" "$2 (y/n)" "$3"
|
ask _yn "$2 (y/n)" "$3" "$1"
|
||||||
eval "v=\$$1"
|
case "$_yn" in [yYдД]*) return 0 ;; *) return 1 ;; esac
|
||||||
case "$v" in [yYдД]*) return 0 ;; *) return 1 ;; esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------- download ----------
|
# ---------- download ----------
|
||||||
|
|||||||
Reference in new issue
Block a user