2020-08-14 20:20:36 -04:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
|
|
|
|
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
|
|
|
|
|
|
|
on_chroot << EOF
|
2020-08-15 00:29:17 -04:00
|
|
|
# If mjpg is already installed, skip this (for debugging)
|
2020-08-14 20:20:36 -04:00
|
|
|
if ! which mjpg_streamer; then
|
|
|
|
cd /tmp
|
2020-08-15 00:29:17 -04:00
|
|
|
# Making sure that this directory doesn't exist
|
2020-08-14 20:20:36 -04:00
|
|
|
rm -rf /tmp/mjpg-streamer
|
|
|
|
git clone https://github.com/jacksonliam/mjpg-streamer/
|
|
|
|
cd mjpg-streamer/mjpg-streamer-experimental/
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
cd /
|
2020-08-15 00:29:17 -04:00
|
|
|
# Cleanup
|
2020-08-14 20:20:36 -04:00
|
|
|
rm -rf /tmp/mjpg-streamer
|
2020-08-16 18:15:54 -04:00
|
|
|
# Create needed folder
|
|
|
|
mkdir -p /var/www/mjpg
|
|
|
|
# Permissions
|
|
|
|
chown octoprint:octoprint /var/www/mjpg
|
2020-08-14 20:20:36 -04:00
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|