forked from Icycoide/shellception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
103 lines (95 loc) · 2.35 KB
/
main.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/env bash
FXTM_VER=3.0-"preview"
main() {
tunnel
}
tunnel() {
echo "
_____ _ _____ _____
| ___| |_ ___ _|_ _|___ / _ __ _ __ ___
| |_ | | | | \ \/ / | | |_ \| '__| '_ ˇ _ \
| _| | | |_| |> < | | ___) | | | | | | | |
|_| |_|\__,_/_/\_\ |_| |____/|_| |_| |_| |_|
Preview
"
fxtm_main
}
fxtm_main() {
read -p "$PWD FxTm3> " FXTM_PROMPT
case "$FXTM_PROMPT" in
"multiScriptEditor")
echo -e "#!/bin/bash\n# This file is important if you want to run multiple commands at once in FluxT3rm.\n# This file gets wiped every time you edit it. To keep the contents of the file,\n# run 'multiScriptEditor --Keep' instead to edit the file while keeping the content aswell. To run the script, type 'multiScriptRun'." > ~/zhcpt.sh
nano ~/zhcpt.sh
chmod +x ~/zhcpt.sh
;;
"multiScriptEditor --Keep")
nano ~/zhcpt.sh
chmod +x ~/zhcpt.sh
;;
"multiScriptRun")
chmod +x ~/zhcpt.sh
sh ~/zhcpt.sh
;;
"help")
echo "
help - Displays this info and all commands
multiScriptEditor - Erases and opens the multiscript file with the nano text editor
-> Options
-> --Keep - Opens the multiscript file without erasing in the nano text editor
multiScriptRun - Runs the multiscript file
about/getAbout - displays FluxT3rm info
shellMode - Lets you run commands in sh/bash
getChildItems - list contents of the directory
exit - Exit FluxT3rm
"
;;
"testCommand")
listChildItems
;;
"about"|"getAbout")
getAbout
;;
"shellMode")
shellMode() {
read -p "$PWD shellMode> " FXTM_PROMPT
case "$FXTM_PROMPT" in
exit)
echo "OK"
;;
*)
$FXTM_PROMPT
shellMode
;;
esac
}
shellMode
;;
"getChildItems")
ls
;;
"exit")
exit
;;
*)
echo "Command $FXTM_PROMPT does not exist. Run the 'help' command for a list of commands, or try running the command inside shellMode." && fxtm_main
;;
esac
fxtm_main
}
getAbout() {
echo "
_____ _ _____ _____
| ___| |_ ___ _|_ _|___ / _ __ _ __ ___
| |_ | | | | \ \/ / | | |_ \| '__| '_ ˇ _ \
| _| | | |_| |> < | | ___) | | | | | | | |
|_| |_|\__,_/_/\_\ |_| |____/|_| |_| |_| |_|
Copyright (c) 2023 Costmiku
Version: $FXTM_VER
OS: $(uname)
PWD: $PWD
Authors: The Costmiku Team, kevadesu
License: MIT
Bug reports: "https://forums.costmiku.org" "https://groups.google.com/g/costmiku-bugs"
"
}
main