From: Aaron Klingaman Date: Thu, 2 Dec 2004 00:00:25 +0000 (+0000) Subject: mildly sanitize network configuration files X-Git-Tag: bootcd_3-0_beta1~27 X-Git-Url: http://git.onelab.eu/?p=bootcd.git;a=commitdiff_plain;h=8a6a03a22cb502d670e44f14ad28ee1afe74f08f mildly sanitize network configuration files --- diff --git a/conf_files/pl_validateconf b/conf_files/pl_validateconf new file mode 100644 index 0000000..1b9d183 --- /dev/null +++ b/conf_files/pl_validateconf @@ -0,0 +1,22 @@ +#!/bin/sh + +# Valid environment variables to appear in a planetlab config file +TAGS='IP_METHOD HOST_NAME DOMAIN_NAME PROXY_SERVER + IP_ADDRESS IP_GATEWAY IP_NETMASK IP_NETADDR IP_BROADCASTADDR + IP_DNS1 IP_DNS2 PRIMARY_DEV PRIMARY_MAC' + +# Valid characters that variable can be set to +CHARS='[:alnum:]\.: _-' + +REGEX='' + +for t in $TAGS +do + if [ "$REGEX" == "" ] + then + REGEX="^$t" + else + REGEX="$REGEX|^$t" + fi +done +/bin/egrep "($REGEX)\=\\\"[$CHARS]*\\\"\s*$"