Bug fixes

This commit is contained in:
Skylar Grant 2023-01-12 19:51:41 -05:00
parent da745e212f
commit afce8a68a7
4 changed files with 14 additions and 5 deletions

View File

@ -132,7 +132,10 @@ const functions = {
return new Promise((resolve) => {
if (config.debugMode) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: Pausing for ${config.intervals.pause}ms`);
functions.sleep(config.intervals.pause).then(() => { resolve(); });
functions.sleep(config.intervals.pause).then((res) => {
if (config.debugMode) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: Pause finished.`);
resolve();
});
});
},
// Reload the environment variables on the fly
@ -239,7 +242,10 @@ const functions = {
});
},
checkForQuit() {
if (config.status.shutdownNextCycle == 1) process.exit();
if (config.status.shutdownNextCycle == 1) {
console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: Exiting Process!`);
process.exit();
}
return new Promise((resolve, reject) => {
if (fs.existsSync('./quit')) {
fs.unlink('./quit', err => {
@ -248,6 +254,8 @@ const functions = {
config.status.auger = 0;
resolve();
});
} else {
resolve('Not shutting down');
}
});
},

View File

@ -35,6 +35,7 @@ echo -e "
[ Hestia Control Panel ]
This script is being run from: '$(pwd)'
Active Nodes: $(ps ax -o pid,user,command | grep 'node websvr.js' | grep -v grep)
Please enter an option from below:
@ -45,7 +46,7 @@ Please enter an option from below:
[0] Quit Control Panel"
# Wait for input
read -p " Option: " opt
read -p "Option: " opt
# Execute the correct commands based on input.
case "$opt" in
@ -64,7 +65,7 @@ case "$opt" in
3)
# View logs
clear
cat log.txt | less
less log.txt
;;
0)
# Exit the script

0
quit
View File

View File

@ -1,5 +1,5 @@
{
"debugMode": false,
"debugMode": true,
"status": {
"igniter": 0,
"blower": 0,