summarylogtreecommitdiffstats
path: root/btsync.install
diff options
context:
space:
mode:
authorava1ar2015-06-12 22:21:10 -0400
committerava1ar2015-06-12 22:21:10 -0400
commit76a8fc2ffae0f5c7db68869e216f976a255dd896 (patch)
tree447c4a9b07ea318f0ce7a43d99e45d341a353fc3 /btsync.install
downloadaur-76a8fc2ffae0f5c7db68869e216f976a255dd896.tar.gz
Initial import
Diffstat (limited to 'btsync.install')
-rw-r--r--btsync.install74
1 files changed, 74 insertions, 0 deletions
diff --git a/btsync.install b/btsync.install
new file mode 100644
index 000000000000..010c85689ee7
--- /dev/null
+++ b/btsync.install
@@ -0,0 +1,74 @@
+post_install() {
+
+ # add btsync user and group if doesn't exist
+ if [ "$(grep btsync /etc/passwd)" == "" ]; then
+ useradd -r -s /bin/sh -d /var/lib/btsync btsync
+ fi
+ # create btsync dir
+ mkdir -p /var/lib/btsync && chown -R btsync:btsync /var/lib/btsync
+
+ post_upgrade
+}
+
+post_upgrade() {
+
+ # following will be moved to post_install eventually
+
+ # create tmpdirs
+ systemd-tmpfiles --create btsync.conf
+ # adjust owner and permissions for config file
+ chown btsync:btsync /etc/btsync.conf
+ chmod 600 /etc/btsync.conf
+
+cat << EOF
+
+ WebGUI can be accessed via following URL: http://localhost:8888
+
+ * Running btsync system instance (using dedicated btsync:btsync account)
+
+ System instance of btsync is preconfigured (configuration file located
+ at /etc/btsync.conf) and can be used directly after installation.
+
+ Execute:
+
+ to reload system systemd modules: systemctl daemon-reload
+ to start btsync manually: systemctl start btsync
+ to autostart btsync on system start: systemctl enable btsync
+
+ * Running btsync user instance (using current user account)
+
+ User instance MUST be configured before use. To perform configuration,
+ install btsync-autoconfig package or follow manual configuration steps:
+
+ 1. Copy /etc/btsync/btsync.conf to ~/.config/btsync/btsync.conf for
+ the user you wish to configure btsync:
+
+ mkdir -p ~/.config/btsync
+ cp /etc/btsync.conf ~/.config/btsync/btsync.conf
+
+ 2. Replace user-specific references with the appropriate information,
+ including the following settings:
+
+ - storage_path
+ - pid_file
+ - webui.listen
+ - webui.login
+ - webui.password
+
+ 3. Make sure folder you specified as storage_path and folder where pid_file will
+ be located both exist in the filesystem, since btsync will not create it for you.
+
+ Execute:
+
+ to reload user systemd modules: systemctl --user daemon-reload
+ to start btsync manually: systemctl --user start btsync
+ to autostart btsync on user login: systemctl --user enable btsync
+
+EOF
+
+}
+
+post_remove() {
+ userdel btsync
+ echo -e "Please remove /var/lib/btsync folder manually"
+}