SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
shellcheck: fix usse -n instead of ! -z (SC2236 SC2237)
Markus Heiserad3273986024
diff --git a/utils/filtron.sh b/utils/filtron.shindex df6932723..2cbea4023 100755--- a/utils/filtron.sh+++ b/utils/filtron.sh@@ -97,7 +97,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"FILTRON_TARGET : ${FILTRON_TARGET}EOF- [ ! -z "${1+x}" ] && err_msg "$1"+ [[ -n ${1} ]] && err_msg "$1"}main() {diff --git a/utils/lib.sh b/utils/lib.shindex 991fe77fa..a7efb78ea 100755--- a/utils/lib.sh+++ b/utils/lib.sh@@ -57,7 +57,7 @@ required_commands() {# usage: requires_commands [cmd1 ...]local exit_val=0- while [ ! -z "$1" ]; do+ while [ -n "$1" ]; doif ! command -v "$1" &>/dev/null; thenerr_msg "missing command $1"@@ -125,7 +125,7 @@ rst_title() {rst_para() {# usage: RST_INDENT=1 rst_para "lorem ipsum ..."local prefix=''- if ! [[ -z $RST_INDENT ]] && [[ $RST_INDENT -gt 0 ]]; then+ if [[ -n $RST_INDENT ]] && [[ $RST_INDENT -gt 0 ]]; thenprefix="$(for i in $(seq 1 "$RST_INDENT"); do printf " "; done)"echo -en "\n$*\n" | $FMT | prefix_stdout "$prefix"else@@ -151,8 +151,8 @@ wait_key(){local msg="${MSG}"[[ -z "$msg" ]] && msg="${_Green}** press any [${_BCyan}KEY${_Green}] to continue **${_creset}"- [[ ! -z $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT- [[ ! -z $_t ]] && _t="-t $_t"+ [[ -n $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT+ [[ -n $_t ]] && _t="-t $_t"printf "$msg"# shellcheck disable=SC2086read -r -s -n1 $_t@@ -167,8 +167,8 @@ ask_yn() {local EXIT_NO=1 # exit status 1 --> error codelocal _t=$3- [[ ! -z $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT- [[ ! -z $_t ]] && _t="-t $_t"+ [[ -n $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT+ [[ -n $_t ]] && _t="-t $_t"case "${FORCE_SELECTION:-${2}}" inY) return ${EXIT_YES} ;;N) return ${EXIT_NO} ;;@@ -218,7 +218,7 @@ tee_stderr () {# hellolocal _t="0";- if [[ ! -z $1 ]] ; then _t="$1"; fi+ if [[ -n $1 ]] ; then _t="$1"; fi(while read -r line; do# shellcheck disable=SC2086@@ -233,7 +233,7 @@ prefix_stdout () {local prefix="${_BYellow}-->|${_creset}"- if [[ ! -z $1 ]] ; then prefix="${_BYellow}$1${_creset}"; fi+ if [[ -n $1 ]] ; then prefix="${_BYellow}$1${_creset}"; fi# shellcheck disable=SC2162(while IFS= read line; do@@ -260,7 +260,7 @@ cache_download() {local exit_value=0- if [[ ! -z ${SUDO_USER} ]]; then+ if [[ -n ${SUDO_USER} ]]; thensudo -u "${SUDO_USER}" mkdir -p "${CACHE}"elsemkdir -p "${CACHE}"@@ -274,7 +274,7 @@ cache_download() {if [[ ! -f "${CACHE}/$2" ]]; theninfo_msg "caching: $1"info_msg " --> ${CACHE}/$2"- if [[ ! -z ${SUDO_USER} ]]; then+ if [[ -n ${SUDO_USER} ]]; thensudo -u "${SUDO_USER}" wget --progress=bar -O "${CACHE}/$2" "$1" ; exit_value=$?elsewget --progress=bar -O "${CACHE}/$2" "$1" ; exit_value=$?@@ -298,8 +298,8 @@ choose_one() {local choice=$1;local max="${#@}"local _t- [[ ! -z $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT- [[ ! -z $_t ]] && _t="-t $_t"+ [[ -n $FORCE_TIMEOUT ]] && _t=$FORCE_TIMEOUT+ [[ -n $_t ]] && _t="-t $_t"list=("$@")echo -e "${_BGreen}Menu::${_creset}"@@ -374,7 +374,7 @@ install_template() {local chmod="${pos_args[4]-644}"info_msg "install (eval=$do_eval): ${dst}"- [[ ! -z $variant ]] && info_msg "variant: ${variant}"+ [[ -n $variant ]] && info_msg "variant: ${variant}"if [[ ! -f "${template_origin}" ]] ; thenerr_msg "${template_origin} does not exists"@@ -386,14 +386,14 @@ install_template() {if [[ "$do_eval" == "1" ]]; thentemplate_file="${CACHE}${dst}${variant}"info_msg "BUILD template ${template_file}"- if [[ ! -z ${SUDO_USER} ]]; then+ if [[ -n ${SUDO_USER} ]]; thensudo -u "${SUDO_USER}" mkdir -p "$(dirname "${template_file}")"elsemkdir -p "$(dirname "${template_file}")"fi# shellcheck disable=SC2086eval "echo \"$(cat ${template_origin})\"" > "${template_file}"- if [[ ! -z ${SUDO_USER} ]]; then+ if [[ -n ${SUDO_USER} ]]; thenchown "${SUDO_USER}:${SUDO_USER}" "${template_file}"fielse@@ -856,8 +856,8 @@ git_clone() {fi[[ -z $branch ]] && branch=master- [[ -z $user ]] && [[ ! -z "${SUDO_USER}" ]] && user="${SUDO_USER}"- [[ ! -z $user ]] && bash_cmd="sudo -H -u $user -i"+ [[ -z $user ]] && [[ -n "${SUDO_USER}" ]] && user="${SUDO_USER}"+ [[ -n $user ]] && bash_cmd="sudo -H -u $user -i"if [[ -d "${dest}" ]] ; theninfo_msg "already cloned: $dest"diff --git a/utils/lxc.sh b/utils/lxc.shindex d0ad49bd1..0c198babc 100755--- a/utils/lxc.sh+++ b/utils/lxc.sh@@ -31,6 +31,7 @@ ubu1804_boilerplate="export DEBIAN_FRONTEND=noninteractiveapt-get install -y git curl wget"+# shellcheck disable=SC2034ubu1904_boilerplate="$ubu1804_boilerplate"REMOTE_IMAGES=()@@ -75,7 +76,7 @@ all LXC containers:${LOCAL_IMAGES[@]}EOF- [ ! -z "${1+x}" ] && err_msg "$1"+ [ -n "${1+x}" ] && err_msg "$1"}lxd_info() {@@ -255,7 +256,7 @@ lxc_boilerplate_containers() {lxc start -q "${HOST_PREFIX}-${shortname}" &>/dev/nullboilerplate_script="${shortname}_boilerplate"boilerplate_script="${!boilerplate_script}"- if [[ ! -z "${boilerplate_script}" ]]; then+ if [[ -n "${boilerplate_script}" ]]; thenecho "$boilerplate_script" \| lxc exec "${HOST_PREFIX}-${shortname}" -- bash \| prefix_stdout " ${HOST_PREFIX}-${shortname} | "@@ -305,11 +306,13 @@ add_subordinate_ids() {del_subordinate_ids() {local out+ local exit_valueif grep "root:${HOST_USER_ID}:1" /etc/subuid -qs; then# TODO: root user is always in use by process 1, how can we remove subordinates?info_msg "remove lxd permission to map ${HOST_USER_ID}'s user/group id through"out=$(usermod --del-subuids "${HOST_USER_ID}-${HOST_USER_ID}" --del-subgids "${HOST_GROUP_ID}-${HOST_GROUP_ID}" root 2>&1)- if [ ! -z $? ]; then+ exit_val=$?+ if [ $exit_val -ne 0 ]; thenerr_msg "$out"fielsediff --git a/utils/morty.sh b/utils/morty.shindex 7a9db08a8..bd4ad5901 100755--- a/utils/morty.sh+++ b/utils/morty.sh@@ -84,7 +84,7 @@ ${DOT_CONFIG#"$REPO_ROOT/"} file::SERVICE_USER : ${SERVICE_USER}EOFinfo_searx- [ ! -z "${1+x}" ] && err_msg "$1"+ [[ -n ${1} ]] && err_msg "$1"}info_searx() {diff --git a/utils/searx.sh b/utils/searx.shindex 5eb16700b..73bdd5510 100755--- a/utils/searx.sh+++ b/utils/searx.sh@@ -110,7 +110,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"SERVICE_USER : ${SERVICE_USER}EOF- [ ! -z "${1+x}" ] && err_msg "$1"+ [[ -n ${1} ]] && err_msg "$1"}main() {