mirror of https://github.com/dirtbags/moth.git
Working, tested p2 console
This commit is contained in:
parent
16c9dc94e5
commit
76e7b5eb98
|
@ -8,7 +8,6 @@ endif
|
||||||
00admin-build: $(00ADMIN_BUILDDIR)/build
|
00admin-build: $(00ADMIN_BUILDDIR)/build
|
||||||
$(00ADMIN_BUILDDIR)/build:
|
$(00ADMIN_BUILDDIR)/build:
|
||||||
$(MAKE) -C packages/00admin/src
|
$(MAKE) -C packages/00admin/src
|
||||||
touch $<
|
|
||||||
|
|
||||||
00admin-install: $(00ADMIN_BUILDDIR)/build
|
00admin-install: $(00ADMIN_BUILDDIR)/build
|
||||||
$(call COPYTREE, packages/00admin/service, $(00ADMIN_PKGDIR)/service)
|
$(call COPYTREE, packages/00admin/service, $(00ADMIN_PKGDIR)/service)
|
||||||
|
|
|
@ -38,7 +38,7 @@ newteam () {
|
||||||
printf '%s' "$name" > $BASE/$hash/.name
|
printf '%s' "$name" > $BASE/$hash/.name
|
||||||
|
|
||||||
cat <<EOD
|
cat <<EOD
|
||||||
Your team hash is $hash. Write that down somewhere and don't lose it.
|
Your team hash is [1m$hash[0m. Write that down somewhere and don't lose it.
|
||||||
If you forget your hash, you'll have to start over from the beginning
|
If you forget your hash, you'll have to start over from the beginning
|
||||||
with a new team and everybody will laugh at you.
|
with a new team and everybody will laugh at you.
|
||||||
EOD
|
EOD
|
||||||
|
@ -69,19 +69,19 @@ clear
|
||||||
|
|
||||||
read -r name < $BASE/$hash/.name
|
read -r name < $BASE/$hash/.name
|
||||||
|
|
||||||
printf 'Welcome back, [34m%s[0m.\n' "$name"
|
printf 'Welcome back, [1m%s[0m.\n' "$name"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
printf "[32mp2>[0m "
|
printf "[7mp2>[0m "
|
||||||
read -r answer
|
read -r answer
|
||||||
|
|
||||||
case "$answer" in
|
case "$answer" in
|
||||||
\?|help)
|
\?|help)
|
||||||
cat <<EOD
|
cat <<EOD
|
||||||
[32m Help
|
[1m Help
|
||||||
----------------------------------------------------------[0m
|
----------------------------------------------------------[0m
|
||||||
|
|
||||||
Type "[34mquit[0m" to leave the p2 shell.
|
Type "[1mquit[0m" to leave the p2 shell.
|
||||||
|
|
||||||
Any other string is checked as an answer. If the answer
|
Any other string is checked as an answer. If the answer
|
||||||
is correct, you are awarded points and the scoreboard will
|
is correct, you are awarded points and the scoreboard will
|
||||||
|
@ -97,7 +97,7 @@ EOD
|
||||||
|
|
||||||
match=$(awk -v ans="$answer" '(substr($0, length($1)+2) == ans) { print substr(FILENAME, 6, length(FILENAME)-17) " " $1; }' /opt/*/answers.txt)
|
match=$(awk -v ans="$answer" '(substr($0, length($1)+2) == ans) { print substr(FILENAME, 6, length(FILENAME)-17) " " $1; }' /opt/*/answers.txt)
|
||||||
if [ -z "$match" ]; then
|
if [ -z "$match" ]; then
|
||||||
echo 'That is not a correct answer. Type "[34mhelp[0m" for help.'
|
echo 'That is not a correct answer. Type "[1mhelp[0m" for help.'
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ EOD
|
||||||
echo "You've already received points for this answer."
|
echo "You've already received points for this answer."
|
||||||
else
|
else
|
||||||
> $fn
|
> $fn
|
||||||
echo "You get $points more points in the $cat category."
|
echo "You get [1m$points[0m more points in the [1m$cat[0m category."
|
||||||
# run puzzles.cgi
|
# run puzzles.cgi
|
||||||
# update scoreboard
|
# update scoreboard
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,4 +2,10 @@
|
||||||
|
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
exec udhcpc -f eth0
|
if grep 'debug' /proc/cmdline; then
|
||||||
|
ip link set dev eth0 up
|
||||||
|
ip addr add dev eth0 10.0.0.110/24
|
||||||
|
exec sleep 8d
|
||||||
|
else
|
||||||
|
exec udhcpc -f eth0
|
||||||
|
fi
|
||||||
|
|
|
@ -3,5 +3,14 @@
|
||||||
# Try hard to look like a serial connection
|
# Try hard to look like a serial connection
|
||||||
|
|
||||||
reset
|
reset
|
||||||
echo 'RS232/0:1200-N81'
|
|
||||||
exec nc 10.0.0.2 56352 2>/dev/null
|
# Print some bullshit to confuse people
|
||||||
|
printf 'RS232/0:1200-N81 '
|
||||||
|
|
||||||
|
# Simulate a green-phosphor CRT
|
||||||
|
printf '\033]P0111122\033]P788ff00\033]Pfff8800'
|
||||||
|
|
||||||
|
# More bullshit
|
||||||
|
printf '[68]\n'
|
||||||
|
|
||||||
|
exec nc 10.0.0.2 5555 2>/dev/null
|
||||||
|
|
|
@ -8,14 +8,14 @@ if ! sv s tty1 | grep down; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Don't let C-A-F2 switch away
|
||||||
|
deallocvt
|
||||||
|
|
||||||
# Disable magic sysrq key
|
# Disable magic sysrq key
|
||||||
echo 0 > /proc/sys/kernel/sysrq
|
echo 0 > /proc/sys/kernel/sysrq
|
||||||
|
|
||||||
# Make this like a VT52; including disabling ctrl-alt-del
|
# Make this like a VT52; including disabling ctrl-alt-del
|
||||||
loadkmap /opt/p2client/dumbterm.kmap
|
loadkmap < /opt/p2client/dumbterm.kmap
|
||||||
|
|
||||||
# Simulate a green-phosphor CRT
|
|
||||||
printf '\033]P0111122\033]P788ff00\033]Pfff8800'
|
|
||||||
|
|
||||||
# Run the console!
|
# Run the console!
|
||||||
exec getty -n -l ./p2connect 38400 tty1
|
exec getty -n -l ./p2connect 38400 tty1
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
U'0絤騺q<1B>p
|
|
Loading…
Reference in New Issue