Deleted Added
full compact
functions-parse.sh (209552) functions-parse.sh (211730)
1#!/bin/sh
2#-
3# Copyright (c) 2010 iXsystems, Inc. All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8# 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24# SUCH DAMAGE.
25#
1#!/bin/sh
2#-
3# Copyright (c) 2010 iXsystems, Inc. All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8# 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24# SUCH DAMAGE.
25#
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-parse.sh 209552 2010-06-27 16:46:11Z imp $
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-parse.sh 211730 2010-08-24 06:11:46Z imp $
27
28# functions.sh
29# Library of functions which pc-sysinstall may call upon for parsing the config
30
31# which gets the value of a setting in the provided line
32get_value_from_string()
33{
34 if [ ! -z "${1}" ]

--- 92 unchanged lines hidden (view full) ---

127# Checks for the presense of the supplied arguements in the config file
128# 1 = values to confirm exist
129file_sanity_check()
130{
131 if [ ! -z "$CFGF" -a ! -z "$1" ]
132 then
133 for i in $1
134 do
27
28# functions.sh
29# Library of functions which pc-sysinstall may call upon for parsing the config
30
31# which gets the value of a setting in the provided line
32get_value_from_string()
33{
34 if [ ! -z "${1}" ]

--- 92 unchanged lines hidden (view full) ---

127# Checks for the presense of the supplied arguements in the config file
128# 1 = values to confirm exist
129file_sanity_check()
130{
131 if [ ! -z "$CFGF" -a ! -z "$1" ]
132 then
133 for i in $1
134 do
135 grep "^${i}=" $CFGF >/dev/null 2>/dev/null
136 if [ "$?" = "0" ]
137 then
138 LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
139 if [ -z "${LN}" ]
140 then
141 echo "Error: Config fails sanity test! ${i}= is empty"
142 exit 1
143 fi
144 else
145 echo "Error: Config fails sanity test! Missing ${i}="
146 exit 1
147 fi
135 grep "^${i}=" $CFGF >/dev/null 2>/dev/null
136 if [ "$?" = "0" ]
137 then
138 LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
139 if [ -z "${LN}" ]
140 then
141 echo "Error: Config fails sanity test! ${i}= is empty"
142 exit 1
143 fi
144 else
145 echo "Error: Config fails sanity test! Missing ${i}="
146 exit 1
147 fi
148 done
149 else
150 echo "Error: Missing config file, and / or values to sanity check for!"
151 exit 1
152 fi
153};
154
155

--- 76 unchanged lines hidden ---
148 done
149 else
150 echo "Error: Missing config file, and / or values to sanity check for!"
151 exit 1
152 fi
153};
154
155

--- 76 unchanged lines hidden ---