serverline-sim/src/modules/systemd.ts

18 lines
340 B
TypeScript
Raw Normal View History

2021-12-12 23:26:22 -05:00
import { exec } from '@kernel:base';
2021-12-22 04:25:12 -05:00
// export default {
// config: {
// }
// }
2021-12-12 23:26:22 -05:00
export function boot() {
for(const [name, script] of Object.entries(this.config)) {
2021-12-22 04:25:12 -05:00
exec(script as string);
2021-12-12 10:53:26 -05:00
}
2021-12-12 23:26:22 -05:00
}
export function add(name: string, ...commandParts: string[]) {
this.config ??= {};
this.config[name] = commandParts.join(' ');
2021-12-12 10:53:26 -05:00
}