Skip to content

Commit 86a67f6

Browse files
committed
long options
1 parent 4d4cb24 commit 86a67f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

usr/sbin/autologinchange

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ disable_autologin() {
104104
fi
105105

106106
pattern="^autologin-user=[[:space:]]*${user}$"
107-
match_count=$(grep -E -c -- "$pattern" "${file_name}") || true
107+
match_count=$(grep --extended-regexp --count -- "$pattern" "${file_name}") || true
108108

109109
sed -i -E "/$pattern/d" -- "${file_name}"
110110

@@ -195,7 +195,7 @@ validate_username() {
195195
filter_out_sysmaint_maybe() {
196196
## This function expects to have data piped to in on standard input.
197197
if [ "${special_sysmaint_handling}" = 'yes' ]; then
198-
grep -v -- 'sysmaint'
198+
grep --invert-match -- 'sysmaint'
199199
else
200200
cat
201201
fi
@@ -426,12 +426,12 @@ fi
426426

427427
## Ensure that lightdm doesn't have a multi-seat configuration, we can't
428428
## safely manage those
429-
if grep -qri -- '^\[Seat:[^*]' /etc/lightdm; then
429+
if grep --quiet --recrusive --ignore-case -- '^\[Seat:[^*]' /etc/lightdm; then
430430
echo "ERROR: Multi-seat lightdm configuration detected, cannot proceed!" >&2
431431
exit 1
432432
fi
433433
readarray -t autologin_users_lightdm < <(
434-
grep -ri -- '^autologin-user=' /etc/lightdm \
434+
grep --quiet --ignore-case -- '^autologin-user=' /etc/lightdm \
435435
| filter_out_sysmaint_maybe \
436436
| awk -F'=' '{ print $NF }' || true
437437
) || true

0 commit comments

Comments
 (0)