forked from Sophia/thelinuxlist
added unattended installs, and bumped golang ver
This commit is contained in:
29
scripts/unattended/hugoinstall.sh
Normal file
29
scripts/unattended/hugoinstall.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
trap 'exit 130' INT
|
||||
if [ ! -x /usr/bin/curl ] ; then
|
||||
CURL_NOT_EXIST=1
|
||||
apt install -y curl
|
||||
else
|
||||
CURL_NOT_EXIST=0
|
||||
fi
|
||||
apt remove golang -y
|
||||
apt autoremove -y
|
||||
wget -O goinstall.sh https://sop.wtf/sh/u/goinstall && bash goinstall.sh
|
||||
rm -rf /tmp/hugo/
|
||||
mkdir /tmp/hugo/
|
||||
VER=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's|[v,]||g' )
|
||||
if [ -n "$(uname -a | grep x86_64)" ]; then
|
||||
curl -fsSL -o "/tmp/hugo/hugo_"$VER"_linux-amd64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"_linux-amd64.tar.gz"
|
||||
fi
|
||||
|
||||
if [ -n "$(uname -a | grep armv6l)" ]; then
|
||||
curl -fsSL -o "/tmp/hugo/hugo_"$VER"-arm64.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"-arm64.tar.gz"
|
||||
fi
|
||||
|
||||
if [ -n "$(uname -a | grep armv7l)" ]; then
|
||||
curl -fsSL -o "/tmp/hugo/hugo_"$VER"-arm.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v$VER/hugo_"$VER"-arm.tar.gz"
|
||||
fi
|
||||
cd /tmp/hugo/
|
||||
tar -xzf /tmp/hugo/*.tar.gz
|
||||
sudo mv /tmp/hugo/hugo /usr/local/bin
|
||||
cd ~
|
Reference in New Issue
Block a user