Support for dash.

This commit is contained in:
nekral-guest
2010-08-26 19:36:43 +00:00
parent 1906527bb8
commit f38390ecf8
@@ -12,7 +12,7 @@ log_start "$0" "userdel accepts when the user is not is shadow"
save_config
# restore the files on exit
trap 'log_status "$0" "FAILURE"; restore_config; kill %1' 0
trap 'log_status "$0" "FAILURE"; restore_config; kill $pid' 0
change_config
@@ -25,7 +25,9 @@ sleep 1
echo -n "Delete user foo (userdel foo)..."
userdel foo 2>tmp/userdel.err && exit 1 || {
status=$?
ps=$(echo $! $?)
pid=$(echo $ps | cut -f1 -d' ')
status=$(echo $ps | cut -f2 -d' ')
}
echo "OK"
@@ -42,8 +44,9 @@ diff -au data/userdel.err tmp/userdel.err
echo "error message OK."
rm -f tmp/userdel.err
kill %1 || true
wait %1 || true
kill $pid || true
wait || true
echo -n "Check the passwd file..."
../../common/compare_file.pl config/etc/passwd /etc/passwd