summarylogtreecommitdiffstats
path: root/octoprint.install
blob: cdb6d888c8b71f9d44a521a5cfa7230a6a2e3ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
post_install() {
	local HOMEDIR=/var/lib/octoprint
	getent group octoprint > /dev/null || groupadd octoprint
	getent passwd octoprint > /dev/null || useradd -d $HOMEDIR -g octoprint -s /usr/bin/nologin octoprint
	usermod -a -G octoprint,network,uucp,tty octoprint
	mkdir -p $HOMEDIR
	chmod 700 $HOMEDIR
	chown -R octoprint:octoprint $HOMEDIR

	echo "To start octoprint, run: systemctl start octoprint"
	echo "To enable octoprint at boot, run: systemctl enable octoprint"
}

post_upgrade() {
 	post_install $1
}

post_remove() {
	echo "To stop octoprint, run: systemctl stop octoprint"
	echo "To disable octoprint at boot, run: systemctl disable octoprint"
 	echo "You may want to remove octoprint user and group"
}