forked from serialhex/bittorrent-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bittorrent-sync.install
46 lines (33 loc) · 1.25 KB
/
bittorrent-sync.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
post_install() {
if [ "$(grep btsync /etc/passwd)" == "" ]; then
useradd -M -r -U -s /bin/sh -d /var/lib/btsync btsync
fi
mkdir -p /var/lib/btsync && chown -R btsync:btsync /var/lib/btsync
cat << EOF
Configuration is located at /etc/btsync.conf and contains sample data.
The corresponding systemd-unit is 'btsync.service'
WebGUI can be accessed at http://localhost:8888
User-specific BTSync configuration
Helps to set ownership to someone other than root for files that are copied
with btsync. A default configuration file is automatically created at
~/.config/btsync/btsync.conf if this file does not exist. You may want to
change the device_name, webui.login and webui.password settings. You can
either edit the config file directly or use the
/usr/share/bittorrent-sync/btsync-makeconfig.sh script, pass it the --help
flag to learn more about it.
To start btsync, execute:
$ systemctl start btsync@user
where 'user' is your username.
================
Note that you may need to run
# systemctl --system daemon-reload
before systemd recognizes the new service definitions.
EOF
}
post_upgrade() {
post_install
}
post_remove() {
userdel btsync
echo -e "Please remove the /var/lib/btsync folder manually."
}