2020-08-11 03:04:29 -04:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2020-08-14 03:40:24 -04:00
|
|
|
install -m 644 files/octoprint.service ${ROOTFS_DIR}/etc/systemd/system/octoprint.service
|
2020-08-11 19:26:21 -04:00
|
|
|
|
2020-08-11 05:18:14 -04:00
|
|
|
on_chroot << EOF
|
2020-08-11 19:26:21 -04:00
|
|
|
if ! pip list | grep -F octoprint; then
|
2020-08-13 05:42:11 -04:00
|
|
|
if [[ ! -d /srv/octoprint ]]; then mkdir -p /srv/octoprint; fi
|
|
|
|
cd /srv/octoprint || exit 1
|
|
|
|
chown octoprint:octoprint /srv/octoprint || exit 1
|
|
|
|
virtualenv venv || exit 1
|
|
|
|
source venv/bin/activate || exit 1
|
|
|
|
pip install pip --upgrade
|
|
|
|
pip install octoprint || exit 1
|
|
|
|
chown -R octoprint:octoprint /srv/octoprint
|
2020-08-11 05:18:14 -04:00
|
|
|
fi
|
|
|
|
EOF
|