diff --git a/README.md b/README.md index 008ecb8..77e1b32 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ You can download and run the installer script: `curl -fsSL https://git.coolaj86.com/coolaj86/gitea-installer.sh/raw/branch/master/install.bash | bash` +You can pick a specific version to install. For example, if you were nostalgic for 1.2.0, you could run `curl -fsSL https://git.coolaj86.com/coolaj86/gitea-installer.sh/raw/branch/master/install.bash | bash -s version 1.2.0` + ## Install Manually Or manually install by reading these instructions and following along: @@ -82,4 +84,4 @@ You can find more information about customization and templates in the docs and # Troubleshooting systemd -See [Troubleshooting systemd](https://git.coolaj86.com/coolaj86/service-installer.sh/src/master/README.md#troubleshooting-systemd) \ No newline at end of file +See [Troubleshooting systemd](https://git.coolaj86.com/coolaj86/service-installer.sh/src/master/README.md#troubleshooting-systemd) diff --git a/install.bash b/install.bash old mode 100644 new mode 100755 index a4dbe23..4b1c0c1 --- a/install.bash +++ b/install.bash @@ -6,9 +6,28 @@ VER=$(curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value sed 's|[v,]||g' ) # Remove v -# wget -O install-gitea.bash https://git.coolaj86.com/coolaj86/gitea-installer/raw/master/install.bash; bash install-gitea.bash -# or -# wget -O - https://git.coolaj86.com/coolaj86/gitea-installer/raw/master/install.bash | bash +while [[ $# -gt 0 ]] +do + key="$1" + + case $key in + -v|version) + VER="$2" + shift # past argument + ;; + *) + # unknown option + if test -z "${unknown}" + then + unknown=$1 + else + echo "Unknown Option" + exit 1 + fi + ;; + esac + shift # past argument or value +done # Create a 'gitea' user and group with the home /opt/gitea, no password (because it's a system user) and no GECOS sudo adduser gitea --home /opt/gitea --disabled-password --gecos ''