confd: add script path option (-s) to migrate script

This allows a user to run in on any system which has the Infix source
code that contains the modification scripts.

Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
Richard Alpe
2025-04-07 15:09:36 +02:00
parent 0ab9e2a36a
commit e3c601f2fd
+6 -1
View File
@@ -13,6 +13,7 @@ usage()
echo " -h This help text"
echo " -i Edit file in-place instead of sending to stdout, like sed"
echo " -q Quiet, skip normal log messages, only errors are logged"
echo " -s PATH Specify custom script path"
echo
echo "By default, this script reads a .cfg file on stdin, or as the first"
echo "non-option argument, then migrates it to a new syntax on stdout."
@@ -121,7 +122,7 @@ chmod 600 "$tmp"
trap cleanup INT HUP TERM EXIT
OPTS=$(getopt -o b:chiq -- "$@")
OPTS=$(getopt -o b:chiqs: -- "$@")
eval set -- "$OPTS"
while [ -n "$1" ]; do
@@ -143,6 +144,10 @@ while [ -n "$1" ]; do
-q)
quiet=1
;;
-s)
scripts=$2
shift
;;
--)
shift
break