on master help sign in
bash scripts: source code cleaned up (shellcheck)
67afa6bMarkus Heiser
utils/lib.sh+5−8
@@ -767,14 +767,10 @@ apache_dissable_site() {
767 sudo -H a2dissite -q "${CONF}"
767 sudo -H a2dissite -q "${CONF}"
768 ;;
768 ;;
769 arch-*)
769 arch-*)
770− mkdir -p "${APACHE_SITES_ENABLED}"
771 rm -f "${APACHE_SITES_ENABLED}/${CONF}"
770 rm -f "${APACHE_SITES_ENABLED}/${CONF}"
772− ln -s "${APACHE_SITES_AVAILABLE}/${CONF}" "${APACHE_SITES_ENABLED}/${CONF}"
773 ;;
771 ;;
774 fedora-*)
772 fedora-*)
775− mkdir -p "${APACHE_SITES_ENABLED}"
776 rm -f "${APACHE_SITES_ENABLED}/${CONF}"
773 rm -f "${APACHE_SITES_ENABLED}/${CONF}"
777− ln -s "${APACHE_SITES_AVAILABLE}/${CONF}" "${APACHE_SITES_ENABLED}/${CONF}"
778 ;;
774 ;;
779 esac
775 esac
780 apache_reload
776 apache_reload
@@ -1314,11 +1310,11 @@ primary_ip() {
1314
1310
1315 case $DIST_ID in
1311 case $DIST_ID in
1316 arch)
1312 arch)
1317− echo "$(ip -o addr show \
1313+ ip -o addr show \
1318− | sed -nr 's/[0-9]*:\s*([a-z0-9]*).*inet[6]?\s*([a-z0-9.:]*).*scope global.*/\2/p' \
1314+ | sed -nr 's/[0-9]*:\s*([a-z0-9]*).*inet[6]?\s*([a-z0-9.:]*).*scope global.*/\2/p' \
1319− | head -n 1)"
1315+ | head -n 1
1320 ;;
1316 ;;
1321− *) echo "$(hostname -I | cut -d' ' -f1)" ;;
1317+ *) hostname -I | cut -d' ' -f1 ;;
1322 esac
1318 esac
1323}
1319}
1324
1320
@@ -1334,5 +1330,6 @@ url_replace_hostname(){
1334 # url_replace_hostname http://searx-ubu1604/morty $(primary_ip)
1330 # url_replace_hostname http://searx-ubu1604/morty $(primary_ip)
1335 # http://10.246.86.250/morty
1331 # http://10.246.86.250/morty
1336
1332
1333+ # shellcheck disable=SC2001
1337 echo "$1" | sed "s|\(http[s]*://\)[^/]*\(.*\)|\1$2\2|"
1334 echo "$1" | sed "s|\(http[s]*://\)[^/]*\(.*\)|\1$2\2|"
1338}
1335}
utils/searx.sh−7
@@ -580,13 +580,6 @@ EOF
580
580
581set_result_proxy() {
581set_result_proxy() {
582 info_msg "try to set result proxy ..."
582 info_msg "try to set result proxy ..."
583− local line
584− local stage=0
585− local url=" url: $1"
586− local key=" key: $2"
587− if [[ -z $2 ]]; then
588− key=
589− fi
590 cp "${SEARX_SETTINGS_PATH}" "${SEARX_SETTINGS_PATH}.bak"
583 cp "${SEARX_SETTINGS_PATH}" "${SEARX_SETTINGS_PATH}.bak"
591 _set_result_proxy "$1" "$2" > "${SEARX_SETTINGS_PATH}"
584 _set_result_proxy "$1" "$2" > "${SEARX_SETTINGS_PATH}"
592}
585}