mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
remove special handling for wget, use environment variables instead
This commit is contained in:
@@ -11,7 +11,6 @@ CFG=/boot/config/proxy.cfg
|
||||
|
||||
# these files are generated by this script based on the data in proxy.cfg
|
||||
PROXY_SH=/etc/profile.d/proxy.sh
|
||||
WGET=/root/.wgetrc
|
||||
|
||||
# random file extension for atomic writes
|
||||
RND=$RANDOM
|
||||
@@ -54,28 +53,6 @@ EOF
|
||||
mv "${FILE}.${RND}" "${FILE}"
|
||||
}
|
||||
|
||||
# write /root/.wgetrc
|
||||
set_wget() {
|
||||
local FILE
|
||||
FILE="${WGET}"
|
||||
cat <<EOF >"${FILE}.${RND}"
|
||||
# Do not edit. This file is autogenerated by /usr/local/sbin/set_proxy
|
||||
use_proxy=yes
|
||||
http_proxy=${proxy_url}
|
||||
https_proxy=${proxy_url}
|
||||
no_proxy="${no_proxy}"
|
||||
EOF
|
||||
chmod 644 "${FILE}.${RND}"
|
||||
mv "${FILE}.${RND}" "${FILE}"
|
||||
}
|
||||
|
||||
# clear /root/.wgetrc
|
||||
unset_wget() {
|
||||
local FILE
|
||||
FILE="${WGET}"
|
||||
[[ -f "${FILE}" ]] && rm "${FILE}"
|
||||
}
|
||||
|
||||
# restart_phpfpm whenever the environment variables change
|
||||
restart_phpfpm () {
|
||||
/etc/rc.d/rc.php-fpm restart > /dev/null
|
||||
@@ -85,7 +62,6 @@ restart_phpfpm () {
|
||||
add_proxy_to_generated_files_and_exit() {
|
||||
echo "generating proxy files"
|
||||
set_proxy_sh
|
||||
set_wget
|
||||
. "${PROXY_SH}"
|
||||
restart_phpfpm
|
||||
[[ -n "${VERBOSE}" ]] && display_generated_files
|
||||
@@ -96,7 +72,6 @@ add_proxy_to_generated_files_and_exit() {
|
||||
remove_proxy_from_generated_files_and_exit() {
|
||||
echo "removing proxy info from generated files"
|
||||
unset_proxy_sh
|
||||
unset_wget
|
||||
. "${PROXY_SH}"
|
||||
restart_phpfpm
|
||||
[[ -n "${VERBOSE}" ]] && display_generated_files
|
||||
@@ -107,7 +82,6 @@ remove_proxy_from_generated_files_and_exit() {
|
||||
display_generated_files() {
|
||||
echo
|
||||
display_generated_file "${PROXY_SH}"
|
||||
display_generated_file "${WGET}"
|
||||
}
|
||||
|
||||
# when verbose mode enabled
|
||||
|
||||
Reference in New Issue
Block a user