summaryrefslogtreecommitdiff
path: root/src/dnsmasq-dhcp-script.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-03-25 14:59:36 -0400
committerAndrew Cady <d@jerkface.net>2017-03-25 14:59:36 -0400
commit72a4f463ce8f21074c70b628bdf7c12fe277b1e2 (patch)
tree73ee1d46ffdbc6684c6ff952eb5271c4123ceb38 /src/dnsmasq-dhcp-script.sh
parent9770d8661315ca1112aa92580c6668ba0885b0c1 (diff)
dnsmasq dhcp-script handles missing gnupghome.tar by generating it
Previously, this condition would cause the client to poll forever.
Diffstat (limited to 'src/dnsmasq-dhcp-script.sh')
-rw-r--r--src/dnsmasq-dhcp-script.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/dnsmasq-dhcp-script.sh b/src/dnsmasq-dhcp-script.sh
index 167d229..7469447 100644
--- a/src/dnsmasq-dhcp-script.sh
+++ b/src/dnsmasq-dhcp-script.sh
@@ -1,8 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2[ "$1" = tftp ] || exit 0
2. samizdat-paths.sh 3. samizdat-paths.sh
3TFTP_ROOT=${samizdat_isolinux_dir} 4TFTP_ROOT=${samizdat_isolinux_dir}
4[ "$1 $4" = "tftp ${TFTP_ROOT}/linux/vmlinuz" ] || exit 5TFTP_FILE=$4
5# $2 is the length of the file 6TFTP_FILE_SIZE=$3
6CLIENT_IP=$3 7CLIENT_IP=$3
7 8
8# dnsmasq clears the environment. kiki needs at least $HOME 9# dnsmasq clears the environment. kiki needs at least $HOME
@@ -60,5 +61,22 @@ cleanup_after_fail()
60 rmdir "$child_dir" 61 rmdir "$child_dir"
61} 62}
62 63
64exit_unless_needed()
65{
66
67 case "$TFTP_FILE" in
68 "${TFTP_ROOT}/linux/vmlinuz")
69 ;;
70 "${TFTP_ROOT}/${CLIENT_IP}/linux/vmlinuz")
71 [ -e "${TFTP_ROOT}/${CLIENT_IP}/gnupghome.tar" ] && exit
72 ;;
73 *) exit
74 ;;
75 esac
76}
77
78exit_unless_needed
79
63debug 80debug
81
64(new_child || cleanup_after_fail) & 82(new_child || cleanup_after_fail) &