fixed rc function: only call rc-script specified with -r

This commit is contained in:
Thomas von Dein
2020-12-19 17:34:53 +01:00
parent c374abf6fa
commit 9bfa539e02

12
jaildk
View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
version=1.14 version=1.15
usage_jaildk() { usage_jaildk() {
beg=`tput -T ${TERM:-cons25} md` beg=`tput -T ${TERM:-cons25} md`
@@ -1076,7 +1076,7 @@ jaildk_rc() {
shift shift
shift shift
rc='' rcd=''
while getopts "r:" arg; do while getopts "r:" arg; do
case $arg in case $arg in
@@ -1085,8 +1085,8 @@ jaildk_rc() {
esac esac
done done
if test -z "$rc"; then if test -z "$rcd"; then
rc='all' rcd='all'
fi fi
if test -z "$jail" -o -z "$mode"; then if test -z "$jail" -o -z "$mode"; then
@@ -1099,7 +1099,7 @@ jaildk_rc() {
rcs=`get_rc_scripts $jail` rcs=`get_rc_scripts $jail`
if test $rc = "all"; then if test $rcd = "all"; then
bold "Jail $jail rc status:" bold "Jail $jail rc status:"
for script in $rcs; do for script in $rcs; do
jexec $jail $script $mode jexec $jail $script $mode
@@ -1107,7 +1107,7 @@ jaildk_rc() {
else else
ok='' ok=''
for script in $rcs; do for script in $rcs; do
if echo "$script" | egrep -q "/$rc"; then if echo "$script" | egrep -q "/${rcd}\$"; then
jexec $jail $script $mode jexec $jail $script $mode
ok=1 ok=1
fi fi