From d0cc92b7c4e5e95bb9a1f1a7fe7138bfeaef24ad Mon Sep 17 00:00:00 2001 From: Tomas Mudrunka Date: Sat, 2 Nov 2013 14:53:44 +0100 Subject: [PATCH] Moar comments --- bash/dhcp-option.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash/dhcp-option.sh b/bash/dhcp-option.sh index 0a1ec6c..e5f825d 100755 --- a/bash/dhcp-option.sh +++ b/bash/dhcp-option.sh @@ -10,16 +10,23 @@ dec_to_hex_right() { } escape() { + #Adds \x escapes to hexdump string + while read -n 2 i; do [ -n "$i" ] && echo -n '\x'"$i"; done } dnsmasq() { + #Converts \x00\x00 notation to 00:00 notation + sed -e 's/^\\x//g' | sed -e 's/\\x/:/g' } dhcp_option() { + #Compile DHCP option using option number and data. + #Generates hex string including header with option number and data length. + separator='\x' option_id="$1" option_data="$2" -- 2.30.2