From f6a4a6bbea15933e5a2b96af453bf491989c7016 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Thu, 11 May 2023 12:08:12 -0400 Subject: [PATCH] add setup_client.sh --- doc/setup_client.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 doc/setup_client.sh diff --git a/doc/setup_client.sh b/doc/setup_client.sh new file mode 100755 index 0000000..24bb79c --- /dev/null +++ b/doc/setup_client.sh @@ -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"