From d40f10d2ee9572e4acaec5c15271a602398eff67 Mon Sep 17 00:00:00 2001 From: millert <> Date: Thu, 30 Dec 2004 17:33:59 +0000 Subject: [PATCH] Add a copy of stripcom so /etc/netstart can be run standalone again. OK deraadt@ --- src/etc/netstart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/etc/netstart b/src/etc/netstart index 9733a44e..b610038f 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,21 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.100 2004/12/19 15:37:58 millert Exp $ +# $OpenBSD: netstart,v 1.101 2004/12/30 17:33:59 millert Exp $ + +# Strip comments (and leading/trailing whitespace if IFS is set) +# from a file and spew to stdout +stripcom() { + local _file="$1" + local _line + + { + while read _line ; do + _line=${_line%%#*} # strip comments + test -z "$_line" && continue + echo $_line + done + } < $_file +} # Returns true if $1 contains only alphanumerics isalphanumeric() {