-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMultiBash.src
More file actions
57 lines (56 loc) · 1.59 KB
/
Copy pathMultiBash.src
File metadata and controls
57 lines (56 loc) · 1.59 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
if active_user != "root" then
print("<size=30><b><color=red>AUTHENTICATION FAILURE.</color></b></size>\n")
pass = user_input("<color=red>ENTER PASSWORD: </color>", true)
shell = get_shell("root",pass)
if globals.shell == null then
print("<color=red>INCORRECT DATA</color>")
sysreboot = get_shell.host_computer.reboot()
if sysreboot == false then exit()
end if
shell.launch(launch_path)
else
shell = get_shell
end if
computer=shell.host_computer
bashFolder=computer.File("/root/multibash/")
if bashFolder == null then
if not computer.File("/root").has_permission("w") then exit("No '/bash/' folder and cannot create one!")
computer.create_folder("/root", "multibash")
end if
simplebash = function
while (1)
o = user_input("_sb> ")
if o.len == 0 then return
l = o.trim.split(" ")
c = l[0]
s = ""
if l.len > 1 then
l.remove 0
s = l.join
end if
o = get_shell.launch(c, s)
if o then print o
end while
exit
end function
bashList = []
bashList.push(@simplebash)
print "[0] SimpleBash"
i = 1
for bash in bashFolder.get_files
if bash == null then continue
if not bash.is_binary then continue
print("[" + i + "] " + bash.name)
bashList.push(bash)
i = i + 1
end for
if bashList.len == 0 then
print("No bash files found! Defaulting to SimpleBash.")
end if
selection = user_input("SELECT A BASH: ",0,1).to_int
if typeof(selection) != "number" then exit("Invalid input!")
if selection == 0 then simplebash
cd(home_dir)
while(true)
shell.launch(bashList[selection].path)
end while