Working, tested p2 console

This commit is contained in:
Neale Pickett 2012-06-11 14:37:39 -06:00
parent a7753f712c
commit 81d52e3bdf
6 changed files with 29 additions and 16 deletions

View File

@ -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)

View File

@ -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 $hash. 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, %s.\n' "$name" printf 'Welcome back, %s.\n' "$name"
while true; do while true; do
printf "p2> " printf "p2> "
read -r answer read -r answer
case "$answer" in case "$answer" in
\?|help) \?|help)
cat <<EOD cat <<EOD
 Help  Help
---------------------------------------------------------- ----------------------------------------------------------
Type "quit" to leave the p2 shell. Type "quit" 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 "help" for help.' echo 'That is not a correct answer. Type "help" 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 $points more points in the $cat category."
# run puzzles.cgi # run puzzles.cgi
# update scoreboard # update scoreboard
fi fi

6
packages/p2client/service/eth0/run Normal file → Executable file
View File

@ -2,4 +2,10 @@
exec 2>&1 exec 2>&1
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 exec udhcpc -f eth0
fi

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
U'0絤騺q<1B>p