Cleanup
This commit is contained in:
parent
72ea910c8d
commit
82e84b4c4e
@ -144,24 +144,26 @@ export async function main(ns) {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!args['skip'] || args['skip'] != 32479805) {
|
||||||
// Banner
|
// Banner
|
||||||
ns.tprint('===================================================');
|
ns.tprint('===================================================');
|
||||||
ns.tprint(`Updating: ${args['device']}`);
|
ns.tprint(`Updating: ${args['device']}`);
|
||||||
ns.tprint('===================================================');
|
ns.tprint('===================================================');
|
||||||
|
}
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
if(!args['skip']) { // Update self & restart
|
if(!args['skip']) { // Update self & restart
|
||||||
await slowPrint(ns, 'Updating self:');
|
await slowPrint(ns, 'Updating self:');
|
||||||
await ns.wget(`${src}${updateFile}`, `${dest}${updateFile}`, args['target']);
|
await ns.wget(`${src}${updateFile}`, `${dest}${updateFile}`, args['device']);
|
||||||
await downloadPrint(ns, `${dest}${updateFile}`);
|
await downloadPrint(ns, `${dest}${updateFile}`);
|
||||||
ns.tprint('');
|
ns.tprint('');
|
||||||
await slowPrint(ns, 'Restarting...');
|
await slowPrint(ns, 'Restarting...');
|
||||||
ns.tprint('');
|
ns.tprint('');
|
||||||
return ns.exec(`${dest}${updateFile}`, args['target'], 1, 1);
|
return ns.exec(`${dest}${updateFile}`, args['device'], 1, 32479805);
|
||||||
} else { // Update everything else
|
} else { // Update everything else
|
||||||
await slowPrint(ns, 'Downloading scripts:');
|
await slowPrint(ns, 'Downloading scripts:');
|
||||||
for(let file of fileList) {
|
for(let file of fileList) {
|
||||||
await ns.wget(`${src}${file}`, `${dest}${file}`, args['target']);
|
await ns.wget(`${src}${file}`, `${dest}${file}`, args['device']);
|
||||||
await downloadPrint(ns, `${dest}${file}`);
|
await downloadPrint(ns, `${dest}${file}`);
|
||||||
}
|
}
|
||||||
ns.tprint('');
|
ns.tprint('');
|
||||||
|
Loading…
Reference in New Issue
Block a user