summarylogtreecommitdiffstats
path: root/goshimmer.install
blob: 83ac78ade4067900516d205ebbb8bdcfe1568ff4 (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
#!/bin/sh

pre_install() {
	if ! id -u goshimmer > /dev/null 2>&1; then
		useradd --no-create-home --system goshimmer > /dev/null
	fi
	mkdir -p /var/lib/goshimmer /etc/goshimmer
}

post_install() {
	chown -R goshimmer:goshimmer /var/lib/goshimmer /etc/goshimmer
}

post_upgrade() {
	chown -R goshimmer:goshimmer /var/lib/goshimmer /etc/goshimmer

	printf  "#############################################################################################\
		\n# Please diff your config in /etc/goshimmer/config.json with the new one provided by the    #\
		\n# package in /etc/goshimmer/config.json.pacnew for any changes made upstream as the upgrade #\
		\n# process doesn't touch your existing configuration.                                        #\
		\n#############################################################################################\n"
}

pre_remove() {
	systemctl stop goshimmer.service
}

post_remove() {
	userdel goshimmer > /dev/null
}