Onionr/install/onionr
2019-07-22 16:59:48 -07:00

24 lines
554 B
Bash
Executable File

#!/bin/sh
set -e
export OUTPUT_DIR=${OUTPUT_DIR:=/usr/share/onionr}
if [ -n "$HOME" ]; then
export XDG_DATA_HOME=${XDG_DATA_HOME:=$HOME/.local/share/onionr}
export ONIONR_HOME=${ONIONR_HOME:=$XDG_DATA_HOME}
export LOG_DIR=${LOG_DIR:=$XDG_DATA_HOME/logs}
else
export ONIONR_HOME=${ONIONR_HOME:=/etc/onionr}
export LOG_DIR=${LOG_DIR:=/var/log/onionr}
fi
mkdir -p "$ONIONR_HOME" "$LOG_DIR"
chmod -R 700 "$ONIONR_HOME" "$LOG_DIR"
chown -R $USER:$USER "$ONIONR_HOME" "$LOG_DIR"
cd "$OUTPUT_DIR/onionr"
exec python3.7 onionr.py "$@"