|
@@ -51,7 +51,7 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
|
|
|
echo ' [-s <shell>] [-u <min-uid>] <username>'
|
|
echo ' [-s <shell>] [-u <min-uid>] <username>'
|
|
|
echo ' group [-c] [-d] <groupname> <min-gid> [<username> ...]'
|
|
echo ' group [-c] [-d] <groupname> <min-gid> [<username> ...]'
|
|
|
echo ' signal [-v] [-t] [-n] [-c] [-d <delay>] [-p <pid>] [-m <pattern>] <sig> [<sig> ...]'
|
|
echo ' signal [-v] [-t] [-n] [-c] [-d <delay>] [-p <pid>] [-m <pattern>] <sig> [<sig> ...]'
|
|
|
- echo ' config [-v] [-a] [-r] [-b <ext>] [-p <tagprefix>] [-t <tagname>] [-i <tagid>] <file>'
|
|
|
|
|
|
|
+ echo ' config [-v] [-s] [-a] [-r] [-b <ext>] [-p <tagprefix>] [-t <tagname>] [-i <tagid>] <file>'
|
|
|
echo ''
|
|
echo ''
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
@@ -136,10 +136,11 @@ case $tool in
|
|
|
opt_m=""
|
|
opt_m=""
|
|
|
;;
|
|
;;
|
|
|
config )
|
|
config )
|
|
|
- str_usage="[-v] [-a] [-r] [-b <ext>] [-p <tagprefix>] [-t <tagname>] [-i <tagid>] <file>"
|
|
|
|
|
|
|
+ str_usage="[-v] [-s] [-a] [-r] [-b <ext>] [-p <tagprefix>] [-t <tagname>] [-i <tagid>] <file>"
|
|
|
arg_spec="1="
|
|
arg_spec="1="
|
|
|
- opt_spec="v.a.r.b:p:t:i:c:"
|
|
|
|
|
|
|
+ opt_spec="v.s.a.r.b:p:t:i:c:"
|
|
|
opt_v=no
|
|
opt_v=no
|
|
|
|
|
+ opt_s=no
|
|
|
opt_a=no
|
|
opt_a=no
|
|
|
opt_r=no
|
|
opt_r=no
|
|
|
opt_b=""
|
|
opt_b=""
|
|
@@ -1096,8 +1097,12 @@ EOT
|
|
|
# add entry
|
|
# add entry
|
|
|
if [ ".$opt_a" = .yes ]; then
|
|
if [ ".$opt_a" = .yes ]; then
|
|
|
if [ ".$check" != . ]; then
|
|
if [ ".$check" != . ]; then
|
|
|
- echo "$msgprefix:Error: config entry already exists" 1>&2
|
|
|
|
|
- exit 1
|
|
|
|
|
|
|
+ if [ ".$opt_s" = .yes ]; then
|
|
|
|
|
+ exit 0
|
|
|
|
|
+ else
|
|
|
|
|
+ echo "$msgprefix:Error: config entry already exists" 1>&2
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
cp $configfile $configfile$ext
|
|
cp $configfile $configfile$ext
|
|
|
echo "${block_start}" >$tmpfile
|
|
echo "${block_start}" >$tmpfile
|
|
@@ -1108,8 +1113,12 @@ EOT
|
|
|
# remove entry
|
|
# remove entry
|
|
|
elif [ ".$opt_r" = .yes ]; then
|
|
elif [ ".$opt_r" = .yes ]; then
|
|
|
if [ ".$check" = . ]; then
|
|
if [ ".$check" = . ]; then
|
|
|
- echo "$msgprefix:Error: config entry does not exist" 1>&2
|
|
|
|
|
- exit 1
|
|
|
|
|
|
|
+ if [ ".$opt_s" = .yes ]; then
|
|
|
|
|
+ exit 0
|
|
|
|
|
+ else
|
|
|
|
|
+ echo "$msgprefix:Error: config entry does not exist" 1>&2
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
cp $configfile $configfile$ext
|
|
cp $configfile $configfile$ext
|
|
|
sed -e "/^${block_start_esc}/,/^${block_end_esc}/d" \
|
|
sed -e "/^${block_start_esc}/,/^${block_end_esc}/d" \
|
|
@@ -1122,7 +1131,9 @@ EOT
|
|
|
if [ ".`cat $tmpfile`" = . ]; then
|
|
if [ ".`cat $tmpfile`" = . ]; then
|
|
|
(diff -C1 $configfile$ext $configfile >$tmpfile) 2>/dev/null
|
|
(diff -C1 $configfile$ext $configfile >$tmpfile) 2>/dev/null
|
|
|
if [ ".`cat $tmpfile`" = . ]; then
|
|
if [ ".`cat $tmpfile`" = . ]; then
|
|
|
- echo "$msgprefix:Warning: unable to show difference for config file \`$configfile'" 1>&2
|
|
|
|
|
|
|
+ if [ ".$opt_s" = .no ]; then
|
|
|
|
|
+ echo "$msgprefix:Warning: unable to show difference for config file \`$configfile'" 1>&2
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
echo "editing $configfile:"
|
|
echo "editing $configfile:"
|