3 # Turns on or off the nss-sysinit module db by editing the
4 # global PKCS #11 congiguration file.
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
8 # and at nss-sysinit pre uninstall with argument off.
13 Usage: setup-nsssysinit [on|off]
14 on - turns on nsssysinit
15 off - turns off nsssysinit
21 if test $# -eq 0; then
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}"
37 sed -e 's/^library=$/library=libnsssysinit.so/' \
38 -e '/^NSS/s/\(Flags=internal\)\(,[^m]\)/\1,moduleDBOnly\2/' > \
40 mv ${p11conf}.on ${p11conf}
43 if [ ! `grep "^library=libnsssysinit" ${p11conf}` ]; then
47 sed -e 's/^library=libnsssysinit.so/library=/' \
48 -e '/^NSS/s/Flags=internal,moduleDBOnly/Flags=internal/' > \
50 mv ${p11conf}.off ${p11conf}