-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckpasswd.sh
executable file
·33 lines (30 loc) · 1.01 KB
/
checkpasswd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -
#===============================================================================
#
# FILE: checkpasswd.sh
#
# USAGE: ./checkpasswd.sh
#
# DESCRIPTION: vérifie que tous les chemins vers les shells de /etc/passwd sont valables
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Dr. Fritz Mehner (fgm), [email protected]
# COMPANY: FH Südwestfalen, Iserlohn
# CREATED: 01/01/2002 12:14:39 CET
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
SHELLS=`gawk -F: '{print $7}' /etc/passwd |sort |uniq |tr '\n' ' '`
#echo "SHELLS vaut $SHELLS"
function F_map_msg_err_si_existe_pas(){
for shell in $@;
do
if [ ! -f "$shell" ]; then echo "le chemin $shell existe pas dans /etc/passwd"; fi
done
}
F_map_msg_err_si_existe_pas "$SHELLS"
# test à claquer en tdd
F_map_msg_err_si_existe_pas "bash"