fixed errors
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
trap 'exit 130' INT
|
||||
while true
|
||||
do
|
||||
read -r -p "Would you like to install Hugo? [Y/n] " input
|
||||
@ -16,26 +16,6 @@ do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
set -b
|
||||
ping -c1 "github.com" &>"/dev/null"
|
||||
ping -c1 "api.github.com" &>"/dev/null"
|
||||
ping -c1 "raw.githubusercontent.com" &>"/dev/null"
|
||||
if [[ "${?}" -ne 0 ]]; then
|
||||
echo "I am unable to access one of the necessary domains that are needed to continue this Install."
|
||||
elif [[ "${#args[@]}" -eq 0 ]]; then
|
||||
# Check if curl is installed
|
||||
if [ ! -x /usr/bin/curl ] ; then
|
||||
CURL_NOT_EXIST=1
|
||||
apt install -y curl
|
||||
else
|
||||
CURL_NOT_EXIST=0
|
||||
fi
|
||||
set -b
|
||||
ping -c1 "go.dev" &>"/dev/null"
|
||||
if [[ "${?}" -ne 0 ]]; then
|
||||
echo "I am unable to access one of the necessary domains that are needed to continue this Install."
|
||||
elif [[ "${#args[@]}" -eq 0 ]]; then
|
||||
# Check if curl is installed
|
||||
if [ ! -x /usr/bin/curl ] ; then
|
||||
CURL_NOT_EXIST=1
|
||||
apt install -y curl
|
||||
@ -43,6 +23,7 @@ else
|
||||
CURL_NOT_EXIST=0
|
||||
fi
|
||||
apt remove golang -y
|
||||
apt autoremove -y
|
||||
rm -rf /tmp/go/
|
||||
mkdir /tmp/go/
|
||||
cd /tmp/go/
|
||||
@ -77,5 +58,4 @@ fi
|
||||
cd /tmp/hugo/
|
||||
tar -xzf /tmp/hugo/*.tar.gz
|
||||
sudo mv /tmp/hugo/hugo /usr/local/bin
|
||||
cd ~
|
||||
fi
|
||||
cd ~
|
Reference in New Issue
Block a user