diff options
author | zeripath <art27@cantab.net> | 2019-05-26 22:49:54 +0100 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-05-26 17:49:54 -0400 |
commit | 2c412f517ae94859b1e42beb24d4bff790484f81 (patch) | |
tree | cb13db25870a953590155a173afdccec1cecf7e3 /contrib | |
parent | d67fd69474d2a67e47cbc8106c15c6d217ae8a0d (diff) | |
download | gitea-2c412f517ae94859b1e42beb24d4bff790484f81.tar.gz gitea-2c412f517ae94859b1e42beb24d4bff790484f81.zip |
Add FHS-compliant-script (#6923)
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fhs-compliant-script/gitea | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/fhs-compliant-script/gitea b/contrib/fhs-compliant-script/gitea new file mode 100755 index 0000000000..28ce651aab --- /dev/null +++ b/contrib/fhs-compliant-script/gitea @@ -0,0 +1,42 @@ +#!/bin/bash + +######################################################################## +# This script some defaults for gitea to run in a FHS compliant manner # +######################################################################## + +# It assumes that you place this script as gitea in /usr/bin +# +# And place the original in /usr/lib/gitea with working files in /var/lib/gitea +# and main configuration in /etc/gitea/app.ini +GITEA="/usr/lib/gitea/gitea" +WORK_DIR="/var/lib/gitea" +APP_INI="/etc/gitea/app.ini" + +APP_INI_SET="" +for i in "$@"; do + case "$i" in + "-c") + APP_INI_SET=1 + ;; + "-c="*) + APP_INI_SET=1 + ;; + "--config") + APP_INI_SET=1 + ;; + "--config="*) + APP_INI_SET=1 + ;; + *) + ;; + esac +done + +if [ -z "$APP_INI_SET" ]; then + CONF_ARG="-c \"$APP_INI\"" +fi + +# Provide FHS compliant defaults to +GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" "$GITEA" $CONF_ARG "$@" + + |