avatar
The Java Sea Traffic Bot

Guest 829 11th Jun, 2021

console.log('🐽 Loading. . . .')
import './lib/LocationData.js'
import path, { dirname } from 'path'
import { spawn } from 'child_process'
import fs from 'fs'
import { fileURLToPath } from 'url'
process.on('uncaughtException', console.error)
const __dirname = dirname(fileURLToPath(import.meta.url))
function start() {
    let args = [path.join(__dirname, 'main.js'), ...process.argv.slice(2)]
    let p = spawn(process.argv[0], args, {
            stdio: ['inherit', 'inherit', 'inherit', 'ipc']
        })
        .on('uncaughtException', console.log)
        .on('message', data => {
            if (data == 'reset') {
                console.log('Restarting...')
                p.kill()
            }
            if (data == 'uptime') {
                console.log('Uptime...')
                p.send(process.uptime())
            }
        })
        .on('exit', code => {
            console.error('Exited with code:', code)
            start()
        })
}

start()
Markup
Description

No description

To share this paste please copy this url and send to your friends
RAW Paste Data