-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinecraftControlPanel.sh
More file actions
137 lines (132 loc) · 4.94 KB
/
MinecraftControlPanel.sh
File metadata and controls
137 lines (132 loc) · 4.94 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh
# For this to work the Minecraft server must be ran inside a screen that was created by the www-data user, or the user that runs
# the webserver (www-data by default). use "sudo -u www-data screen -A -m -d -S minecraft" to start the screen through www-data.
# Then use "sudo -u www-data screen -x minecraft" to enter the screen and start the server.
echo "Content-type: text/html\n"
# read in our parameters
CMD=`echo "$QUERY_STRING" | sed -n 's/^.*cmd=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
FOLDER=`echo "$QUERY_STRING" | sed -n 's/^.*folder=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"`
FOLDER1=`echo "$QUERY_STRING" | sed -n 's/^.*folder1=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"`
FOLDER2=`echo "$QUERY_STRING" | sed -n 's/^.*folder2=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"| sed "s/%2F/\//g"`
# our html header
echo "<style>\n#submit {\n\twidth: 140px;\n\theight: 60px;\nfont-size: 1.3em;\n}</style>"
echo "<style>\n#suicide {\n\twidth: 140px;\n\theight: 60px;\nbackground-color: red;\nfont-size: 1.3em;\n}</style>"
echo "<html>"
echo "<head>\n"
echo "<title>Nate's Minecraft Control Panel</title>\n"
echo "<link rel=icon type=image/ico href=favicon.png />"
echo "</head>\n"
echo "<body>"
# test if any parameters were passed
if [ $CMD ]
then
case "$CMD" in
Home)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger home^M'
;;
Back)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger back^M'
;;
SetHome)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger sethome^M'
;;
Spawn)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger spawn^M'
;;
Jay)
screen -S minecraft -p 0 -X stuff 'tp happy_dagger neeher^M'
;;
Tyler)
screen -S minecraft -p 0 -X stuff 'tp happy_dagger vladiemir^M'
;;
Kelsey)
screen -S minecraft -p 0 -X stuff 'tp happy_dagger bopx^M'
;;
Hollow-Island)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp HollowIsland^M'
;;
Battlefield)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp Battlefield^M'
;;
Castle)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp Castle^M'
;;
Stable)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp Stable^M'
;;
Witch)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp Witch^M'
;;
Town)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp Town^M'
;;
Nates-Castle)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp NatesCastle^M'
;;
First-Town)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger warp FirstTown^M'
;;
Time)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger time^M'
;;
Compass)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger Compass^M'
;;
Position)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger GetPos^M'
;;
Basic-Tools)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger Kit Tools^M'
;;
List)
screen -S minecraft -p 0 -X stuff 'sudo happy_dagger List^M'
;;
Suicide)
screen -S minecraft -p 0 -X stuff 'kill happy_dagger^M'
;;
esac
fi
# print out the form
# page header
echo "<p>"
echo "<center>"
echo "<h2>Nate's Minecraft Control Panel</h2>"
echo "</center>"
echo "<h2>Quick Travel</h2>"
echo "<form method=get>"
echo "<!--"
echo "<input type=radio name=cmd value=Home checked> Teleport Home<br>"
echo "<input type=radio name=cmd value=Bome checked> Teleport Back<br>"
echo "<input type=submit>"
echo "-->"
echo "<input name=cmd value=Home type=submit id=submit>"
echo "<input name=cmd value=Back type=submit id=submit>"
echo "<input name=cmd value=SetHome type=submit id=submit>"
echo "<input name=cmd value=Spawn type=submit id=submit>"
echo "<h2>Teleport</h2>"
echo "<input name=cmd value=Jay type=submit id=submit>"
echo "<input name=cmd value=Tyler type=submit id=submit>"
echo "<input name=cmd value=Kelsey type=submit id=submit>"
echo "<h2>Warp</h2>"
echo "<input name=cmd value=Hollow-Island type=submit id=submit>"
echo "<input name=cmd value=Castle type=submit id=submit>"
echo "<input name=cmd value=Battlefield type=submit id=submit>"
echo "<input name=cmd value=Witch type=submit id=submit>"
echo "</br>"
echo "</br>"
echo "<input name=cmd value=Stable type=submit id=submit>"
echo "<input name=cmd value=Nates-Castle type=submit id=submit>"
echo "<input name=cmd value=Town type=submit id=submit>"
echo "<input name=cmd value=First-Town type=submit id=submit>"
echo "<h2>Misc.</h2>"
echo "<input name=cmd value=Time type=submit id=submit>"
echo "<input name=cmd value=Compass type=submit id=submit>"
echo "<input name=cmd value=Position type=submit id=submit>"
echo "<input name=cmd value=Basic-Tools type=submit id=submit>"
echo "</br>"
echo "</br>"
echo "<input name=cmd value=List type=submit id=submit>"
echo "<input name=cmd value=Suicide type=submit id=suicide>"
echo "</form>"
echo "</body>"
echo "</html>"