parent
ecc831a341
commit
0941d67557
|
@ -26,14 +26,6 @@ curl() {
|
||||||
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
|
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_if_running_as_root() {
|
|
||||||
# If you want to run as another user, please modify $UID to be owned by this user
|
|
||||||
if [[ "$UID" -ne '0' ]]; then
|
|
||||||
echo "error: You must run this script as root!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
download_files() {
|
download_files() {
|
||||||
if ! curl -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}" "${1}"; then
|
if ! curl -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}" "${1}"; then
|
||||||
echo 'error: Download failed! Please check your network or try again.'
|
echo 'error: Download failed! Please check your network or try again.'
|
||||||
|
@ -64,7 +56,6 @@ install_file() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
check_if_running_as_root
|
|
||||||
download_files $DOWNLOAD_LINK_GEOIP $file_ip
|
download_files $DOWNLOAD_LINK_GEOIP $file_ip
|
||||||
download_files $DOWNLOAD_LINK_GEOSITE $file_dlc
|
download_files $DOWNLOAD_LINK_GEOSITE $file_dlc
|
||||||
check_sum
|
check_sum
|
||||||
|
|
|
@ -44,14 +44,6 @@ systemd_cat_config() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_if_running_as_root() {
|
|
||||||
# If you want to run as another user, please modify $UID to be owned by this user
|
|
||||||
if [[ "$UID" -ne '0' ]]; then
|
|
||||||
echo "error: You must run this script as root!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
identify_the_operating_system_and_architecture() {
|
identify_the_operating_system_and_architecture() {
|
||||||
if [[ "$(uname)" == 'Linux' ]]; then
|
if [[ "$(uname)" == 'Linux' ]]; then
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
|
@ -499,7 +491,6 @@ show_help() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
check_if_running_as_root
|
|
||||||
identify_the_operating_system_and_architecture
|
identify_the_operating_system_and_architecture
|
||||||
judgment_parameters "$@"
|
judgment_parameters "$@"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue