summaryrefslogtreecommitdiff
path: root/localnotifypwexp
diff options
context:
space:
mode:
Diffstat (limited to 'localnotifypwexp')
-rwxr-xr-xlocalnotifypwexp8
1 files changed, 2 insertions, 6 deletions
diff --git a/localnotifypwexp b/localnotifypwexp
index e6e2ef6..29811a7 100755
--- a/localnotifypwexp
+++ b/localnotifypwexp
@@ -30,9 +30,7 @@ declare -r aged=21 # minimum days after expiration before admins are emailed, se
hostname=$(hostname --fqdn)
domainname=$(hostname --domain)
-# /etc/shadow is system dependent
-shadowfile="/etc/shadow"
-# fields in /etc/shadow
+# fields in shadow file (system dependent)
declare -r last=2
#declare -r may=3 # not used in this script
declare -r must=4
@@ -50,10 +48,8 @@ declare -r unamefield=1
declare -r uidmin=1000
declare -r uidmax=65534 # exclusive
-# remove the hardcoded path from these progs to use them via $PATH
# mailx is system dependent
notifyprog="mailx"
-grepprog="grep"
awkprog="awk"
dateprog="date"
@@ -109,7 +105,7 @@ for user in $users;
do
IFS=":"
- usershadow=$($grepprog ^$user $shadowfile)
+ usershadow=$(getent shadow $user)
# make an array out of it
usershadow=($usershadow)