3 rootdb="/etc/pki/nssdb"
4 userdb="$HOME/.pki/nssdb"
6 libfile="/run/current-system/sw/lib/libbeidpkcs11.so"
13 (Un)register $dbentry with NSS-compatible browsers.
15 Usage: `basename "$0"` [OPTION] ACTION [LIBRARY]
18 --db PATH use custom NSS database directory PATH
19 --user use user NSS database $userdb (default)
20 --system use global NSS database $rootdb
21 --help show this message
24 add add $dbentry to NSS database
25 remove remove $dbentry from NSS database
26 show show $dbentry NSS database entry
28 Default arguments if unspecified:
34 --user) dbdir="$userdb"
39 -*) echo "$0: unknown option: '$1'" >&2
40 echo "Try --help for usage information."
48 if ! [ -f "$libfile" ]; then
49 echo "$0: error: '$libfile' not found" >&2
55 if ! [ -d "$dbdir" ]; then
56 echo "$0: error: '$dbdir' must be a writable directory" >&2
62 echo "NSS database: $dbdir"
63 echo "BEID library: $libfile"
66 add) echo "Adding $dbentry to database:"
67 modutil -dbdir "$dbdir" -add "$dbentry" -libfile "$libfile" ||
68 echo "Tip: try removing the module before adding it again." ;;
69 remove) echo "Removing $dbentry from database:"
70 modutil -dbdir "$dbdir" -delete "$dbentry" ;;
71 show) echo "Displaying $dbentry database entry, if any:"
72 echo "Note: this may fail if you don't have the correct permissions." ;;
73 '') exec "$0" --help ;;
74 *) echo "$0: unknown action: '$1'" >&2
75 echo "Try --help for usage information."
81 modutil -dbdir "$dbdir" -list "$dbentry" 2>/dev/null