core: lxc avahi check

This commit is contained in:
Koushik Dutta
2024-03-20 20:39:07 -07:00
parent 50d9cee8ea
commit 776356fc02
3 changed files with 11 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/core",
"version": "0.3.14",
"version": "0.3.15",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/core",
"version": "0.3.14",
"version": "0.3.15",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.3.14",
"version": "0.3.15",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -19,6 +19,14 @@ export async function checkLxcDependencies() {
needRestart = true;
}
if (!fs.existsSync('/var/run/avahi-daemon/socket')) {
const cp = child_process.spawn('sh', ['-c', 'apt install avahi-daemon']);
const [exitCode] = await once(cp, 'exit');
if (exitCode !== 0)
sdk.log.a('Failed to install avahi-daemon.');
else
needRestart = true;
}
const scryptedService = fs.readFileSync('scrypted.service').toString();
const installedScryptedService = fs.readFileSync('/etc/systemd/system/scrypted.service').toString();