summarylogtreecommitdiffstats
path: root/sftpman.install
blob: 6b28872e6217387239d270ffb9f295c07fab654a (plain)
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
_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
}