diff --git a/src/js/remotebuzzer_server.js b/src/js/remotebuzzer_server.js index 4b2259363..1025614d8 100644 --- a/src/js/remotebuzzer_server.js +++ b/src/js/remotebuzzer_server.js @@ -314,7 +314,11 @@ function gpioSanity(gpioconfig) { const configPath = fs.existsSync('/boot/firmware/config.txt') ? '/boot/firmware/config.txt' - : '/boot/config.txt'; + : fs.existsSync('/boot/config.txt') + ? '/boot/config.txt' + : (() => { + throw new Error('Configuration file not found'); + })(); cmd = 'sed -n "s/^gpio=\\(.*\\)=pu/\\1/p" ' + configPath; stdout = execSync(cmd).toString();