1234567891011121314151617181920212223242526272829303132333435363738 |
- post_install()
- {
- getent group utserver &>/dev/null || groupadd --system utserver
- if getent passwd utserver &>/dev/null
- then
- usermod -c 'utorrent-server' -d /srv/utserver -s /bin/false utserver &>/dev/null
- else
- useradd -c 'utorrent-server' --system -g utserver -d /srv/utserver -s /bin/false utserver &>/dev/null
- fi
- passwd -l utserver &>/dev/null
- chown utserver:utserver /srv/utserver/{.,downloads,settings,torrents}
-
- cat << _EOF
- >>> The default download directory is /srv/utserver/downloads/
- The default web UI is http://admin:@localhost:8080/gui/
- If utserver has CPU-usage issues, try enabling 'net.low_cpu' in the
- Advanced Options.
- _EOF
- true
- }
- post_upgrade()
- {
- post_install $*
- }
- pre_remove()
- {
- systemctl stop utserver &>/dev/null
- }
- post_remove()
- {
- getent passwd utserver &>/dev/null && userdel utserver
- getent group utserver &>/dev/null && groupdel utserver
- true
- }
|