1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-13 15:27:28 +00:00
Lars Brinkhoff f77c78363e Properly quote name of started program.
So that a space in the name isn't mistaken for the start of the next
argument, which is the process ID to kill later.
2025-01-28 10:23:52 +01:00

52 lines
861 B
Bash
Executable File

#!/bin/sh
# Optional; needed for networking.
SUDO=sudo
#NET_DEFAULT_IF=eth1
EXIT=:
trap "" QUIT INT TERM
started() {
EXIT="$EXIT;stop \"$1\" $2"
trap "$EXIT" EXIT
echo "$1 started, pid $2"
}
stop() {
echo -n "Stopping $1... "
kill "$2" 2> /dev/null
sleep 2
kill -9 "$2" 2> /dev/null
echo "OK"
}
chaosnet() {
(sleep 2; tools/cbridge/cbridge -c build/cbridge.conf >cbridge.log 2>&1) &
started "Chaosnet bridge" "$!"
}
help() {
cat <<EOF
This start script takes several command line arguments:
help - Display this help text.
chaosnet - Start a local Chaosnet.
EOF
touch out/klh10/nohelp
}
test -f out/klh10/nohelp || help
while test -n "$1"; do
"$1"
shift
done
cd build/klh10
rm -f dskdmp.ini
ln -s ../../out/klh10/dskdmp.ini .
$SUDO KLH10_NET_DEFAULT_IF=$NET_DEFAULT_IF ./kn10-ks-its dskdmp.ini