]>
git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/nss/setup-nsssysinit.sh
3 # Turns on or off the nss-sysinit module db by editing the
4 # global PKCS #11 congiguration file. Displays the status.
6 # This script can be invoked by the user as super user.
7 # It is invoked at nss-sysinit post install time with argument on.
12 Usage: setup-nsssysinit [on|off]
13 on - turns on nsssysinit
14 off - turns off nsssysinit
15 status - reports whether nsssysinit is turned on or off
25 # the system-wide configuration file
26 p11conf
="/etc/pki/nssdb/pkcs11.txt"
27 # must exist, otherwise report it and exit with failure
28 if [ ! -f $p11conf ]; then
29 echo "Could not find ${p11conf}"
33 # check if nsssysinit is currently enabled or disabled
36 grep -q '^library=libnsssysinit' ${p11conf}
42 if sysinit_enabled
; then
46 sed -e 's/^library=$/library=libnsssysinit.so/' \
47 -e '/^NSS/s/\(Flags=internal\)\(,[^m]\)/\1,moduleDBOnly\2/' > \
49 mv ${p11conf}.on
${p11conf}
52 if ! sysinit_enabled
; then
56 sed -e 's/^library=libnsssysinit.so/library=/' \
57 -e '/^NSS/s/Flags=internal,moduleDBOnly/Flags=internal/' > \
59 mv ${p11conf}.off
${p11conf}
62 echo -n 'NSS sysinit is '
63 sysinit_enabled
&& echo 'enabled' ||
echo 'disabled'