From 688e1e31cde719406d9acae6cd76f7e6823e2932 Mon Sep 17 00:00:00 2001 From: Filip Borum Poulsen Date: Thu, 21 Mar 2024 14:20:17 +0100 Subject: [PATCH] ADD restart --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 1385c62..d1f333c 100644 --- a/index.js +++ b/index.js @@ -131,5 +131,11 @@ app.post('/upload', function (req, res) { } }); + try { + require('child_process').spawn('sudo', ['systemctl', 'restart', 'video-player2.service']); + } catch (error) { + console.error(error); + } + res.redirect('/'); }); \ No newline at end of file