Onionr/install/onionr

17 lines
419 B
Plaintext
Raw Permalink Normal View History

2019-03-29 03:33:14 +00:00
#!/bin/sh
set -e
2019-09-29 23:44:59 +00:00
if [[ $EUID -eq 0 ]]; then
export ONIONR_HOME=${ONIONR_HOME:-/var/lib/onionr}
export LOG_DIR=${LOG_DIR:-/var/log/onionr}
2019-07-22 23:59:48 +00:00
else
2019-09-29 23:44:59 +00:00
export ONIONR_HOME=${ONIONR_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/onionr}
export LOG_DIR=${LOG_DIR:-$ONIONR_HOME/logs}
2019-07-22 23:59:48 +00:00
fi
mkdir -p "$ONIONR_HOME" "$LOG_DIR"
2019-09-29 23:44:59 +00:00
chmod 0700 "$ONIONR_HOME" "$LOG_DIR"
2019-07-22 23:59:48 +00:00
2019-09-29 23:44:59 +00:00
exec ${ONIONR_BASEDIR:-/usr/share/onionr}/onionr.sh "$@"