scripts/net.js
/**
 * Do something with the monitoring subsystem
 *
 * @param {string} host - the host to run against
 * @param {*} args - flags passed in from the command line.
 * @param {import('/scripts/index.js').NS} ns
 */
Do something with the monitoring subsystem
@param {string} host - the host to run against
@param {*} args - flags passed in from the command line.
Do something with the monitoring subsystem @param { string } host - the host to run against @param { * } args - flags passed in from the command line .
async function runMonitorCommand(host, args, ns) {
    if (args.help) {
        let msg = 'monitor commands. net monitor [DisplayType] to change the running display type. Will also try to open the tail window.';
        ns.tprint(msg);
    } else {
        let mon = subsystems.find((sys) => sys.name === 'net-monitor');
        if (mon.status !== 'RUNNING') {
            ns.exec('/scripts/net-monitor.js', host, 1, '--start');
        }
        mon.refreshStatus(ns);
        if (args._.length > 0) {
            let display = args._.shift();
            let cmd = new C2Command('net-monitor', 'net', 'set', 'display', display, ns);
            await sendC2message(cmd, ns);
        }
    }
}
async function runMonitorCommand ( host , args , ns ) { if ( args . help ) { let msg = 'monitor commands. net monitor [DisplayType] to change the running display type. Will also try to open the tail window.' ; ns . tprint ( msg ) ; } else { let mon = subsystems . find ( ( sys ) => sys . name === 'net-monitor' ) ; if ( mon . status !== 'RUNNING' ) { ns . exec ( '/scripts/net-monitor.js' , host , 1 , '--start' ) ; } mon . refreshStatus ( ns ) ; if ( args . _ . length > 0 ) { let display = args . _ . shift ( ) ; let cmd = new C2Command ( 'net-monitor' , 'net' , 'set' , 'display' , display , ns ) ; await sendC2message ( cmd , ns ) ; } } }
Do something with the monitoring subsystem
 @param {string} host - the host to run against
 @param {*} args - flags passed in from the command line.
Do something with the monitoring subsystem @param { string } host - the host to run against @param { * } args - flags passed in from the command line .
// See if we can find a tail window to open // Broadcast to the monitor app.