diff options
author | Minteck <contact@minteck.org> | 2022-05-26 09:43:42 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-05-26 09:43:42 +0200 |
commit | 006aaff302a0e4027f7daff5f5fa732b2dae686e (patch) | |
tree | cc03f20661d2b4515a5721f13a04c5f960303629 | |
parent | 6d06d9a96bb089254aa89dae0ae49f73c8d8bfe4 (diff) | |
download | vaportrail-006aaff302a0e4027f7daff5f5fa732b2dae686e.tar.gz vaportrail-006aaff302a0e4027f7daff5f5fa732b2dae686e.tar.bz2 vaportrail-006aaff302a0e4027f7daff5f5fa732b2dae686e.zip |
Prepare implementing CI
-rw-r--r-- | index.js | 12 | ||||
-rwxr-xr-x | vaportrail | 13 |
2 files changed, 25 insertions, 0 deletions
@@ -25,9 +25,21 @@ // noinspection JSUnresolvedVariable,HttpUrlsUsage +// Imports and stuff const express = require('express'); +const fs = require('fs'); const app = express(); +// Restart manager +async function restartManager() { + if (fs.existsSync("./RESTART")) { + fs.rmSync("./RESTART", { recursive: true }); + console.log("Restart requested."); + process.exit(14); + } +} +setInterval(restartManager, 500) + // Public pages app.get('/', (req, res) => { res.render("index"); diff --git a/vaportrail b/vaportrail new file mode 100755 index 0000000..2cd2792 --- /dev/null +++ b/vaportrail @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +if ! command -v node &> /dev/null +then + echo "'node' not found in PATH, please install NodeJS." + exit +fi +x_run () { + node index.js + if [[ $? -eq 14 ]]; then + x_run + fi +} +x_run
\ No newline at end of file |