summarylogtreecommitdiffstats
path: root/octoprint.install
blob: 216d54b5a10ecd782a0a9c85e6a7195275cb86e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
	chown -R octoprint:octoprint /opt/octoprint-venv

	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"
}