summarylogtreecommitdiffstats
path: root/sftpman.install
diff options
context:
space:
mode:
authorSlavi Pantaleev2015-07-29 02:40:46 +0300
committerSlavi Pantaleev2015-07-29 02:40:46 +0300
commite5f9d7f9ac789b3dd2fd2c9dfb960c53a5df6471 (patch)
treeff2401a1cdcc42b9e6c0d458cbeadd03c95781e8 /sftpman.install
downloadaur-e5f9d7f9ac789b3dd2fd2c9dfb960c53a5df6471.tar.gz
Initial commit
Diffstat (limited to 'sftpman.install')
-rw-r--r--sftpman.install32
1 files changed, 32 insertions, 0 deletions
diff --git a/sftpman.install b/sftpman.install
new file mode 100644
index 000000000000..6b28872e6217
--- /dev/null
+++ b/sftpman.install
@@ -0,0 +1,32 @@
+_ensure_mount_path() {
+ mkdir -p -m 775 /mnt/sshfs
+ chown :users /mnt/sshfs
+}
+
+post_install() {
+ _ensure_mount_path
+
+ # Let's see if everything is OK now..
+ # This may not be very accurate, because it runs as root,
+ # but it may still catch some potential problems.
+ output=$(sftpman preflight_check 2>&1)
+ if [ ! "$?" = "0" ]; then
+ echo -e "sftpman preflight_check results:\n"
+ echo "$output"
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ echo "Unmounting any sftpman-mounted filesystems.."
+ # The sleep.d script knows how to unmount sftpman filesystems for all users.
+ # It's usually used during suspend/hibernate.
+ /etc/pm/sleep.d/49-sftpman suspend
+}
+
+post_remove() {
+ rmdir --ignore-fail-on-non-empty /mnt/sshfs
+}