forked from openSUSE/aaa_base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaaa_base.pre
41 lines (40 loc) · 1000 Bytes
/
aaa_base.pre
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
34
35
36
37
38
39
40
41
#!/bin/bash
#
# Run this script in C-Locale, or some tools will fail.
export LC_ALL=C
#
# we have several local files, that changed over the time. Check the
# existing one, if they contain real data. If not, delete them.
#
for LOCALFILE in /root/bin/cron.daily.local \
/etc/init.d/boot.local \
/etc/init.d/after.local \
/etc/init.d/before.local \
/etc/init.d/halt.local \
/usr/sbin/usradd.local \
/usr/sbin/usrdel.local \
/usr/sbin/userdel.local ; do
test -f $LOCALFILE || continue
LOCALFILE_CONTAINS_DATA=false
while read LINE ; do
case "$LINE" in
"#"*)
;;
"echo "*">"*)
LOCALFILE_CONTAINS_DATA=true
;;
"echo "*)
;;
". /etc/rc.config")
;;
"exit "*)
;;
"")
;;
*)
LOCALFILE_CONTAINS_DATA=true
;;
esac
done < $LOCALFILE
test "$LOCALFILE_CONTAINS_DATA" = false && rm -f $LOCALFILE
done