2019-03-28 18:01:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
[ "root" != "$USER" ] && exec sudo $0 "$@"
|
|
|
|
|
|
|
|
export OUTPUT_DIR=${OUTPUT_DIR:=/usr/share/onionr}
|
|
|
|
|
2019-03-30 23:21:12 +00:00
|
|
|
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
|
2019-03-30 23:02:16 +00:00
|
|
|
|
2019-03-30 23:21:12 +00:00
|
|
|
mkdir -p "$ONIONR_HOME" "$LOG_DIR"
|
|
|
|
|
|
|
|
cd "$OUTPUT_DIR/onionr"
|
|
|
|
exec python3.7 onionr.py "$@"
|