summarylogtreecommitdiffstats
path: root/rslsync.install
diff options
context:
space:
mode:
authorwido2016-09-25 15:20:48 +0200
committerwido2016-09-25 15:20:48 +0200
commit075621738383f812406c9aed8188c41a72a93950 (patch)
tree93672bd7ed26cbdc5ba98fdab9ea74c602d3915b /rslsync.install
downloadaur-075621738383f812406c9aed8188c41a72a93950.tar.gz
origin
Diffstat (limited to 'rslsync.install')
-rw-r--r--rslsync.install74
1 files changed, 74 insertions, 0 deletions
diff --git a/rslsync.install b/rslsync.install
new file mode 100644
index 000000000000..f5b863a1b1eb
--- /dev/null
+++ b/rslsync.install
@@ -0,0 +1,74 @@
+post_install() {
+
+ # add rslsync user and group if doesn't exist
+ if [ "$(grep rslsync /etc/passwd)" == "" ]; then
+ useradd -r -s /bin/sh -d /var/lib/rslsync rslsync
+ fi
+ # create rslsync dir
+ mkdir -p /var/lib/rslsync && chown -R rslsync:rslsync /var/lib/rslsync
+
+ post_upgrade
+}
+
+post_upgrade() {
+
+ # following will be moved to post_install eventually
+
+ # create tmpdirs
+ systemd-tmpfiles --create rslsync.conf
+ # adjust owner and permissions for config file
+ chown rslsync:rslsync /etc/rslsync.conf
+ chmod 600 /etc/rslsync.conf
+
+cat << EOF
+
+ WebGUI can be accessed via following URL: http://localhost:8888
+
+ * Running rslsync system instance (using dedicated rslsync:rslsync account)
+
+ System instance of rslsync is preconfigured (configuration file located
+ at /etc/rslsync.conf) and can be used directly after installation.
+
+ Execute:
+
+ to reload system systemd modules: systemctl daemon-reload
+ to start rslsync manually: systemctl start rslsync
+ to autostart rslsync on system start: systemctl enable rslsync
+
+ * Running rslsync user instance (using current user account)
+
+ User instance MUST be configured before use. To perform configuration,
+ install rslsync-autoconfig package or follow manual configuration steps:
+
+ 1. Copy /etc/rslsync/rslsync.conf to ~/.config/rslsync/rslsync.conf for
+ the user you wish to configure rslsync:
+
+ mkdir -p ~/.config/rslsync
+ cp /etc/rslsync.conf ~/.config/rslsync/rslsync.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 rslsync will not create it for you.
+
+ Execute:
+
+ to reload user systemd modules: systemctl --user daemon-reload
+ to start rslsync manually: systemctl --user start rslsync
+ to autostart rslsync on user login: systemctl --user enable rslsync
+
+EOF
+
+}
+
+post_remove() {
+ userdel rslsync
+ echo -e "Please remove /var/lib/rslsync folder manually"
+}