Fix Debian install script
This commit is contained in:
parent
50d0366e47
commit
00d9ae975e
@ -5,7 +5,7 @@ OUTPUT_DIR='/usr/share/onionr'
|
||||
DATA_DIR='/etc/onionr'
|
||||
LOG_DIR='/var/log/onionr'
|
||||
|
||||
BRANCH='master'
|
||||
BRANCH='easy-releases'
|
||||
|
||||
# setup error handlers
|
||||
|
||||
@ -43,12 +43,10 @@ echo -e "\033[0;32mInstalling pip dependencies...\033[0m"
|
||||
|
||||
python3.7 -m pip install --no-input -r "$OUTPUT_DIR/requirements.txt" --require-hashes > /dev/null
|
||||
|
||||
# create nologin onionr user if not exists
|
||||
|
||||
id -u onionr &>/dev/null || useradd -r -s /bin/false onionr
|
||||
# set permissions on Onionr directory
|
||||
|
||||
chmod 755 "$OUTPUT_DIR"
|
||||
chown -R onionr:onionr "$OUTPUT_DIR"
|
||||
chown -R root:root "$OUTPUT_DIR"
|
||||
|
||||
# create directories
|
||||
|
||||
@ -56,7 +54,7 @@ mkdir -p "$OUTPUT_DIR/onionr/data" "$LOG_DIR"
|
||||
mv "$OUTPUT_DIR/onionr/data" "$DATA_DIR"
|
||||
|
||||
chmod -R 750 "$DATA_DIR" "$LOG_DIR"
|
||||
chown -R onionr:onionr "$DATA_DIR" "$LOG_DIR"
|
||||
chown -R root:root "$DATA_DIR" "$LOG_DIR"
|
||||
|
||||
# create executable
|
||||
|
||||
@ -67,6 +65,8 @@ chown root:root "$EXECUTABLE"
|
||||
|
||||
# create systemd service
|
||||
|
||||
echo -e "\033[0;32mCreating systemd unit...\033[0m"
|
||||
|
||||
SERVICE='/etc/systemd/system/onionr.service'
|
||||
|
||||
cp "$OUTPUT_DIR/install/onionr.service" "$SERVICE"
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
[ "root" != "$USER" ] && exec sudo $0 "$@"
|
||||
|
||||
export OUTPUT_DIR=${OUTPUT_DIR:=/usr/share/onionr}
|
||||
|
||||
if [ -n "$HOME" ]; then
|
||||
@ -18,5 +16,7 @@ fi
|
||||
|
||||
mkdir -p "$ONIONR_HOME" "$LOG_DIR"
|
||||
|
||||
chmod -R 700 "$ONIONR_HOME" "$LOG_DIR"
|
||||
|
||||
cd "$OUTPUT_DIR/onionr"
|
||||
exec python3.7 onionr.py "$@"
|
||||
|
@ -4,11 +4,11 @@ Requires=network.target tor.service
|
||||
After=network.target tor.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="DATA_DIR=/usr/share/onionr"
|
||||
Environment="LOG_DIR=/var/log/onionr/"
|
||||
ExecStart=/usr/bin/onionr --start
|
||||
ExecStop=/usr/bin/onionr --stop
|
||||
Type=simple
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
Loading…
Reference in New Issue
Block a user