Skip to content

Commit

Permalink
fix(install.sh): drop check_url (pacstall#1168)
Browse files Browse the repository at this point in the history
Co-authored-by: ook37 <[email protected]>
  • Loading branch information
oklopfer and ook37 authored Jul 4, 2024
1 parent ffc144c commit 47412dd
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,6 @@ function fancy_message() {
esac
}

function check_url() {
http_code="$(curl -o /dev/null -s --head --write-out '%{http_code}\n' -- "${1}")"
case "${http_code}" in
000)
fancy_message error "Failed to download file, check your connection"
error_log 1 "get ${PACKAGE} pacscript"
return 1
;;
404)
fancy_message error "The URL cannot be found"
return 1
;;
200 | 301 | 302)
true
;;
*)
fancy_message error "Failed with http code ${http_code}"
return 1
;;
esac
}

((EUID != 0)) && { fancy_message error "Must be root to install Pacstall!"; exit 1; }

if [[ ! -t 0 ]]; then
Expand All @@ -96,13 +74,6 @@ fi

echo -e "${PACYELLOW}┌────────────────────────┐\n│ ${PACCYAN}Pacstall Installer${PACYELLOW} │\n└────────────────────────┘${NC}"

if [[ ${GITHUB_ACTIONS} != "true" ]]; then
check_url "https://github.com" || {
fancy_message error "Could not connect to the internet"
exit 1
}
fi

echo
if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -7)" ]]; then
fancy_message info "Updating"
Expand Down

0 comments on commit 47412dd

Please sign in to comment.