From 1f473b929e7b5f30b8770fb976411ee56c5f6be3 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Fri, 21 Oct 2022 02:59:13 -0700 Subject: [PATCH] Add 'scripts/gogsinstall.sh' --- scripts/gogsinstall.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 scripts/gogsinstall.sh diff --git a/scripts/gogsinstall.sh b/scripts/gogsinstall.sh new file mode 100644 index 0000000..3bbafd8 --- /dev/null +++ b/scripts/gogsinstall.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +while true +do + read -r -p "Would you like to install Gogs? [Y/n] " input + + case $input in + [yY][eE][sS]|[yY]) + break + ;; + [nN][oO]|[nN]) + break + ;; + *) + echo "That wasn't an option..." + ;; + esac +done +sudo apt install wget -y +export VER=0.12.10 +sudo wget https://dl.gogs.io/0.12.10/gogs_{VER}_linux_amd64.tar.gz +tar xvf linux_amd64.tar.gz +sudo apt install git -y +sudo adduser git +sudo mkdir /var/log/gogs +sudo chown -R git:git /var/log/gogs/ +sudo wget -O /etc/systemd/system/gogs.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/gogs.service +sudo rsync -avz gogs/* /home/git/ +sudo chown -R git:git /home/git/ +sudo systemctl daemon-reload +sudo systemctl enable gogs +sudo systemctl start gogs + +echo -e "==================================================================" +publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org ) +intenalip=$(ip addr | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -E -v "^127\.|^255\.|^0\." | head -n 1) + echo "Gogs Should be available at http://${intenalip}:3000" + echo "Or If you are using a VPS at http://${publicipaddress}:3000" +echo -e "==================================================================" \ No newline at end of file