Merge branch 'master' into 'master'

Fixes for Linux install files

See merge request beardog/Onionr!26
master
Kevin 2019-09-29 23:44:59 +00:00
commit 86ae8327c3
2 changed files with 15 additions and 23 deletions

View File

@ -1,23 +1,16 @@
#!/bin/sh #!/bin/sh
set -e set -e
export OUTPUT_DIR=${OUTPUT_DIR:=/usr/share/onionr} if [[ $EUID -eq 0 ]]; then
export ONIONR_HOME=${ONIONR_HOME:-/var/lib/onionr}
if [ -n "$HOME" ]; then export LOG_DIR=${LOG_DIR:-/var/log/onionr}
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 else
export ONIONR_HOME=${ONIONR_HOME:=/etc/onionr} export ONIONR_HOME=${ONIONR_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/onionr}
export LOG_DIR=${LOG_DIR:=/var/log/onionr} export LOG_DIR=${LOG_DIR:-$ONIONR_HOME/logs}
fi fi
mkdir -p "$ONIONR_HOME" "$LOG_DIR" mkdir -p "$ONIONR_HOME" "$LOG_DIR"
chmod -R 700 "$ONIONR_HOME" "$LOG_DIR" chmod 0700 "$ONIONR_HOME" "$LOG_DIR"
chown -R $USER:$USER "$ONIONR_HOME" "$LOG_DIR"
cd "$OUTPUT_DIR/onionr" exec ${ONIONR_BASEDIR:-/usr/share/onionr}/onionr.sh "$@"
exec python3.7 onionr.py "$@"

View File

@ -1,21 +1,20 @@
[Unit] [Unit]
Description=Onionr Daemon Description=Onionr Daemon
Documentation=https://onionr.net/docs/ Documentation=https://onionr.net/docs/
After=network.target tor.service After=network-online.target
Requires=network.target tor.service systemd-networkd-wait-online.service Requires=network-online.target
[Service] [Service]
Environment="DATA_DIR=/usr/share/onionr" Environment="ONIONR_HOME=/var/lib/onionr"
Environment="LOG_DIR=/var/log/onionr/" Environment="LOG_DIR=/var/log/onionr"
ExecStart=/usr/bin/onionr --start ExecStart=/usr/bin/onionr start
ExecStop=/usr/bin/onionr --stop ExecStop=/usr/bin/onionr stop
KillMode=mixed KillMode=mixed
KillSignal=SIGQUIT KillSignal=SIGQUIT
TimeoutStopSec=5s TimeoutStopSec=30s
Type=simple
Restart=on-abnormal Restart=on-abnormal
[Install] [Install]
WantedBy=tor.service WantedBy=multi-user.target