summarylogtreecommitdiffstats
path: root/psd.install
blob: be3e68971640c747b57805cfb1a566756afad37f (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
post_install() {
	echo '--> WARNING! DEVELOPMENT VERSION!'
	echo '--> ALWAYS backup your profile data before using utils like psd!'
	echo
	echo ' SPECIAL UPGRADE INSTRUCTIONS YOU MUST FOLLOW:'
	echo
	echo '1) If you are running psd version 5.x YOU MUST STOP IT BEFORE CONTINUING.'
	echo
	echo '2) If any browsers are running, exit them now.'
	echo
	echo '3) The new psd.conf resides in $HOME/.psd/psd.conf'
	echo '   and it will be created for you on first use.'
	echo
	echo '4) Starting with version 6 of psd, there will be no /etc/psd.conf'
	echo '   nor will you use systemd in system mode to call the service.'
	echo '   Each user shall run his/her own USER psd.service to use'
	echo '   like this: systemctl --user start psd.service'
	echo
	echo '5) Users wanting to use overlayfs mode MUST have sudo access to'
	echo '   both mount and umount or psd will exit informing you of this.'
}

pre_upgrade() {
	## arg 1:  the new package version
	## arg 2:  the old package version
	oldpkgver=${2%-*}

	if [[ $oldpkgver < 5.99 ]]; then
		if [ -e /run/psd ]; then
			if ! systemd-notify --booted; then # not using systemd  
				echo '--> Pacman must stop psd before it can upgrade.'
				echo '--> Please start it manually once the upgrade is complete.'
				/etc/rc.d/psd stop
			else
				echo '--> Pacman must stop psd before it can upgrade.'
				echo '--> Please start it manually once the upgrade is complete.'
				/usr/bin/systemctl stop psd
			fi
		fi
	fi
}