-
Notifications
You must be signed in to change notification settings - Fork 0
/
ops_loader.ks
40 lines (38 loc) · 1.48 KB
/
ops_loader.ks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@LAZYGLOBAL OFF.
{
__["pOut"]("LEC OPS_LOADER v$$VER_NUM$$.$$REL_NUM$$.$$PAT_NUM$$ $$BLD_NUM$$").
local sName is __["padRep"](0,"_",SHIP:NAME).
// check for connection to KSC for archive volume access if no instructions stored
if not (HOMECONNECTION:ISCONNECTED) {
__["pOut"]("Out of range, checking for operations file...").
local bop is __["findPath"]("operations.ks").
if bop <> "" {
__["pOut"]("Found " + bop + ".").
RUNPATH(bop).
__["pOut"]("Operations execution complete").
wait 2.
reboot.
}
__["pOut"]("waiting for KSC link...").
wait until HOMECONNECTION:ISCONNECTED.
__["pOut"]("KSC link established, fetching operations file...").
}
// check for a new bootscript
// destroy the log if needed to make room, but only if it'll make room
local bfn is __["loadScript"](sName + ".boot.ks", TRUE, FALSE).
if bfn <> "" {
movepath(bfn, CORE:VOLUME:BOOTFILENAME).
__["pOut"]("New boot file received.").
} else {
// check for new operations
// destroy the log if needed to make room, but only if it'll make room
local ofn is __["loadScript"](sName + ".op.ks", TRUE, FALSE).
if ofn <> "" {
__["pOut"]("Executing operations file.").
RUNPATH(ofn).
__["pOut"]("Operations execution complete.").
}
}
wait 2.
reboot.
}