summarylogtreecommitdiffstats
path: root/synergy2-bin.install
blob: b8a43c344b01c6cdbdc7bf150f08ff41311e36b1 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
post_install() {
	chmod 777 /var/log/synergy
	chmod 777 /var/lib/synergy
	chmod 777 /etc/synergy
	xdg-icon-resource forceupdate --theme hicolor &> /dev/null
	if [ "upgrade" != $1 ]; then
		systemctl enable synergy.service >/dev/null || true
		if [ -d /run/systemd/system ]; then
			systemctl --system daemon-reload >/dev/null || true
			systemctl restart synergy.service >/dev/null || true
		fi
	fi

	if which update-icon-caches >/dev/null 2>&1 ; then
		update-icon-caches /usr/share/icons/synergy.svg
	fi
	update-desktop-database -q
}

post_upgrade() {
	post_install "upgrade"
}

pre_remove() {
	if [ -d /run/systemd/system ]; then
		systemctl stop synergy.service >/dev/null
	fi
}

post_remove() {
	xdg-icon-resource forceupdate --theme hicolor &> /dev/null
	if which update-icon-caches >/dev/null 2>&1 ; then
		update-icon-caches /usr/share/icons/synergy.svg
	fi
	if [ -d /run/systemd/system ]; then
		systemctl --system daemon-reload >/dev/null || true
	fi
	
	# In case this system is running systemd, we make systemd reload the unit files
	# to pick up changes.
	if [ -d /run/systemd/system ] ; then
		systemctl --system daemon-reload >/dev/null || true
	fi
	if [ "$1" = "remove" ]; then
		if [ -x "/usr/bin/deb-systemd-helper" ]; then
			deb-systemd-helper mask synergy.service >/dev/null
		fi
	fi

	if [ "$1" = "purge" ]; then
		if [ -x "/usr/bin/deb-systemd-helper" ]; then
			deb-systemd-helper purge synergy.service >/dev/null
			deb-systemd-helper unmask synergy.service >/dev/null
		fi
	fi
	update-desktop-database -q
}