Browse code

utils: Change sh(1) "test ==" usage to "="

The POSIX sh(1) specification says that strings are compared with
test(1) (also "[") with "=". Bash accepts "==" and this leads to
non-portable code. This commit simply changes "==" within test/[ to
"=".

Greg Troxel authored on 29/11/2019 01:53:23
Showing 1 changed files
... ...
@@ -153,7 +153,7 @@ kamailio_dump()  # pars: <database name>
153 153
 		merr "kamailio_dump function takes two param"
154 154
 		exit 1
155 155
 	fi
156
-	if [ "$USED_DBENGINE" == "oracle" ]; then
156
+	if [ "$USED_DBENGINE" = "oracle" ]; then
157 157
 		oracle_dump $1 $2
158 158
 	elif [ "$PW" = "" ] ; then
159 159
 		$DUMP_CMD $1 > $2
... ...
@@ -174,7 +174,7 @@ kamailio_restore() #pars: <database name> <filename>
174 174
 		merr "kamailio_restore function takes two params"
175 175
 		exit 1
176 176
 	fi
177
-	if [ "$USED_DBENGINE" == "oracle" ]; then
177
+	if [ "$USED_DBENGINE" = "oracle" ]; then
178 178
 		oracle_restore $1 $2
179 179
 	else
180 180
 		sql_query $1 < $2
... ...
@@ -290,7 +290,7 @@ kamailio_pframework() #pars: <action>
290 290
 case $1 in
291 291
 	copy)
292 292
 		# copy database to some other name
293
-		if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
293
+		if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
294 294
 			merr "$USED_DBENGINE don't support this operation"
295 295
 			exit 1
296 296
 		fi
... ...
@@ -323,7 +323,7 @@ case $1 in
323 323
 		exit $ret
324 324
 		;;
325 325
 	backup)
326
-		if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
326
+		if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
327 327
 			merr "$USED_DBENGINE don't support this operation"
328 328
 			exit 1
329 329
 		fi
... ...
@@ -337,7 +337,7 @@ case $1 in
337 337
 		exit $?
338 338
 		;;
339 339
 	restore)
340
-		if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
340
+		if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
341 341
 			merr "$USED_DBENGINE don't support this operation"
342 342
 			exit 1
343 343
 		fi