Merge branch 'b3tuning-install-mjpg-steamer-fix'

This commit is contained in:
th33xitus
2021-05-25 12:16:27 +02:00
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
### base variables ### base variables
SYSTEMDDIR="/etc/systemd/system" SYSTEMDDIR="/etc/systemd/system"
WEBCAMD_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/home/root/bin/webcamd" WEBCAMD_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/root/usr/local/bin/webcamd"
WEBCAM_TXT_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/boot/mainsail.txt" WEBCAM_TXT_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/home/pi/klipper_config/webcam.txt"
install_mjpg-streamer(){ install_mjpg-streamer(){
### checking dependencies ### checking dependencies
@@ -49,8 +49,8 @@ install_mjpg-streamer(){
</html> </html>
EOT EOT
sudo wget $WEBCAMD_SRC -O "/usr/local/bin/webcamd" sudo wget $WEBCAMD_SRC -O "/usr/local/bin/webcamd"
sudo sed -i "/^config_dir=/ s|=.*|=$klipper_cfg_loc|" /usr/local/bin/webcamd
sudo sed -i "/MJPGSTREAMER_HOME/ s/pi/${USER}/" /usr/local/bin/webcamd sudo sed -i "/MJPGSTREAMER_HOME/ s/pi/${USER}/" /usr/local/bin/webcamd
sudo sed -i "/^cfg_files+=/ s|=.*|=$WEBCAM_TXT|" /usr/local/bin/webcamd
sudo chmod +x /usr/local/bin/webcamd sudo chmod +x /usr/local/bin/webcamd
### step 4: create webcam.txt config file ### step 4: create webcam.txt config file

View File

@@ -399,6 +399,11 @@ remove_mjpg-streamer(){
ok_msg "MJPG-Streamer Service removed!" ok_msg "MJPG-Streamer Service removed!"
fi fi
### remove webcamd from /usr/local/bin
if [ -e "/usr/local/bin/webcamd" ]; then
sudo rm -f "/usr/local/bin/webcamd"
fi
### remove MJPG-Streamer directory ### remove MJPG-Streamer directory
if [ -d ${HOME}/mjpg-streamer ]; then if [ -d ${HOME}/mjpg-streamer ]; then
status_msg "Removing MJPG-Streamer directory ..." status_msg "Removing MJPG-Streamer directory ..."