Commit eeb8a35a authored by Ahmad's avatar Ahmad

init

parent 4ce6316e
Pipeline #195 canceled with stages
...@@ -11,6 +11,7 @@ async function run() { ...@@ -11,6 +11,7 @@ async function run() {
try { try {
const data = await getTunnel(); const data = await getTunnel();
const config = data.config; const config = data.config;
console.log('data getter',config)
await processConfig(config); await processConfig(config);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
...@@ -22,9 +23,14 @@ async function processConfig(newConfig) { ...@@ -22,9 +23,14 @@ async function processConfig(newConfig) {
const currentConfig = await fs.readFile(CONFIG_PATH, 'utf8'); const currentConfig = await fs.readFile(CONFIG_PATH, 'utf8');
if (currentConfig !== newConfig) { if (currentConfig !== newConfig) {
console.log('config is not same try change and reload')
await fs.writeFile(CONFIG_PATH, newConfig); await fs.writeFile(CONFIG_PATH, newConfig);
await reloadHAProxy(); await reloadHAProxy();
} }
else
{
console.log('config is same')
}
} catch (error) { } catch (error) {
throw error; throw error;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment