Browse Source

Distro: do not install MediaMTX; disable a mediamtx service left by an older package

after.php no longer installs /srv/mediamtx into /opt and the systemd unit;
la_mojo serves the live view and the recording itself. If a mediamtx
service exists, it is stopped and disabled (it would hold the WebRTC port).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
pull/28/head
Claude 54 minutes ago
parent
commit
ba7c152861
Failed to extract signature
  1. 17
      Distro/tmp/after.php

17
Distro/tmp/after.php

@ -12,14 +12,17 @@
$CMD = `chown -R www-data:www-data /srv/www/module/lib/controller/data/uploads`; $CMD = `chown -R www-data:www-data /srv/www/module/lib/controller/data/uploads`;
$CMD = `chmod -R 0775 /srv/www/module/lib/controller/data/reports`; $CMD = `chmod -R 0775 /srv/www/module/lib/controller/data/reports`;
//Setup MediaMTX
$CMD = `systemctl stop mediamtx.service`; // just to be sure
$CMD = `rm -f -R /opt/mediamtx`;
$CMD = `mv -f /srv/mediamtx /opt`;
$CMD = `mv -f /opt/mediamtx/mediamtx.service /etc/systemd/system/mediamtx.service`;
//MediaMTX is not installed any more: la_mojo serves the live view (WebRTC) and the recording itself.
//A mediamtx service left by an older package would hold the WebRTC port: stop and disable it.
$OUT = array();
$RC = 1;
exec( 'systemctl list-unit-files --no-legend mediamtx.service 2>/dev/null', $OUT, $RC );
if( ( $RC == 0 && count( $OUT ) > 0 ) || file_exists( '/etc/systemd/system/mediamtx.service' ) ){
echo "MediaMTX service found: stopping and disabling it\n";
$CMD = `systemctl stop mediamtx.service 2>&1`;
$CMD = `systemctl disable mediamtx.service 2>&1`;
};
$CMD = `systemctl daemon-reload`; $CMD = `systemctl daemon-reload`;
$CMD = `systemctl enable mediamtx.service`;
$CMD = `systemctl enable argus_nginx`; $CMD = `systemctl enable argus_nginx`;
//Restore Settings //Restore Settings
function restore_whole_line( $A, $B , $C ){ function restore_whole_line( $A, $B , $C ){

Loading…
Cancel
Save