add setup_client.sh

This commit is contained in:
Peter McGoron 2023-05-11 12:08:12 -04:00
parent 9c2731ad8d
commit f6a4a6bbea
1 changed files with 17 additions and 0 deletions

17
doc/setup_client.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ $(id -u) != 0 ]; then
echo 'script must be run as root'
exit 1
fi
INTER="$1"
BINARY="$(realpath $2)"
ip link set "$INTER" up
ip addr add 192.168.1.100/24 dev "$INTER"
BOOTDIR=$(mktemp -d)
cp "$BINARY" "$BOOTDIR"
cd "$BOOTDIR"
dnsmasq -d --port=0 --enable-tftp --tftp-root="$BOOTDIR" --user=root --group=root --interface="$INTER"