mirror of https://github.com/dirtbags/moth.git
Working, tested p2 console
This commit is contained in:
parent
f53296c611
commit
575a4dc43d
|
@ -8,7 +8,6 @@ endif
|
|||
00admin-build: $(00ADMIN_BUILDDIR)/build
|
||||
$(00ADMIN_BUILDDIR)/build:
|
||||
$(MAKE) -C packages/00admin/src
|
||||
touch $<
|
||||
|
||||
00admin-install: $(00ADMIN_BUILDDIR)/build
|
||||
$(call COPYTREE, packages/00admin/service, $(00ADMIN_PKGDIR)/service)
|
||||
|
|
|
@ -38,7 +38,7 @@ newteam () {
|
|||
printf '%s' "$name" > $BASE/$hash/.name
|
||||
|
||||
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
|
||||
with a new team and everybody will laugh at you.
|
||||
EOD
|
||||
|
@ -69,19 +69,19 @@ clear
|
|||
|
||||
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
|
||||
printf "[32mp2>[0m "
|
||||
printf "[7mp2>[0m "
|
||||
read -r answer
|
||||
|
||||
case "$answer" in
|
||||
\?|help)
|
||||
cat <<EOD
|
||||
[32m Help
|
||||
[1m Help
|
||||
----------------------------------------------------------[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
|
||||
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)
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -108,7 +108,7 @@ EOD
|
|||
echo "You've already received points for this answer."
|
||||
else
|
||||
> $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
|
||||
# update scoreboard
|
||||
fi
|
||||
|
|
|
@ -2,4 +2,10 @@
|
|||
|
||||
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
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
# Don't let C-A-F2 switch away
|
||||
deallocvt
|
||||
|
||||
# Disable magic sysrq key
|
||||
echo 0 > /proc/sys/kernel/sysrq
|
||||
|
||||
# Make this like a VT52; including disabling ctrl-alt-del
|
||||
loadkmap /opt/p2client/dumbterm.kmap
|
||||
|
||||
# Simulate a green-phosphor CRT
|
||||
printf '\033]P0111122\033]P788ff00\033]Pfff8800'
|
||||
loadkmap < /opt/p2client/dumbterm.kmap
|
||||
|
||||
# Run the console!
|
||||
exec getty -n -l ./p2connect 38400 tty1
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
U'0絤騺q<1B>p
|
Loading…
Reference in New Issue