10-04-2024, 11:09 PM
Here's the code that manages Plexamp during moode startup. It's in /var/www/daemon/worker.php.
Update the service file to reflect the userid and home directory.
Your nice installer/updater script would make things much easier but it does some CLI prompting which isn't really WebUI friendly. Moode already has all the deps (I think) except for nodejs.
Could the script be adapted so it doesn't require user input?
What is jq?
Update the service file to reflect the userid and home directory.
Code:
// Start Plexamp renderer
if ($_SESSION['feat_bitmask'] & FEAT_PLEXAMP) {
if ($_SESSION['plexamp_installed'] == 'yes') {
sysCmd("sed -i '/User=/c \User=" . $_SESSION['user_id'] . "' /etc/systemd/system/plexamp.service");
sysCmd("sed -i '/WorkingDirectory=/c \WorkingDirectory=/home/" . $_SESSION['user_id'] . "/plexamp' /etc/systemd/system/plexamp.service");
sysCmd("sed -i '/ExecStart=/c \ExecStart=/usr/bin/node /home/" . $_SESSION['user_id'] . "/plexamp/js/index.js' /etc/systemd/system/plexamp.service");
if (isset($_SESSION['pasvc']) && $_SESSION['pasvc'] == 1) {
$status = 'started';
startPlexamp();
} else {
$status = 'available';
}
} else {
$status = 'not installed';
}
} else {
$status = 'n/a';
}
Your nice installer/updater script would make things much easier but it does some CLI prompting which isn't really WebUI friendly. Moode already has all the deps (I think) except for nodejs.
Could the script be adapted so it doesn't require user input?
What is jq?