diff --git a/src/watcher.ts b/src/watcher.ts index 32ce33e..43ba503 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -24,9 +24,13 @@ export async function main(ns : NS) : Promise { }) for(const process of processes) { - ns.tprint(`INFO: Restarting ${process.filename} ${process.args} -t ${process.threads}`) - ns.kill(process.pid, ns.getHostname()) - ns.run(process.filename, process.threads, ...process.args) + if(process.filename != ns.getScriptName()) { + ns.tprint(`INFO: Restarting ${process.filename} ${process.args} -t ${process.threads}`) + ns.kill(process.pid, ns.getHostname()) + ns.run(process.filename, process.threads, ...process.args) + } else { + ns.spawn(process.filename, process.threads, ...process.args) + } } hashes[file] = hash