forked from AvANa-BBS/freepto-lb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vinc3nt
committed
Oct 2, 2014
1 parent
c566684
commit aa533af
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
_help() { | ||
cat << EOF | ||
usage: | ||
$0 print [icedove|iceweasel] | ||
$0 add [icedove|iceweasel] cert_file cert_name | ||
$0 del [icedove|iceweasel] cer_name | ||
EOF | ||
} | ||
|
||
_print_certs() { | ||
echo "Print certificates stored into: $1" | ||
certutil -L -d $1 | ||
} | ||
|
||
_add_cert() { | ||
cert_file=$1 | ||
cert_name=$2 | ||
certutil -A -n "${cert_name}" -t "TCu,Cuw,Cuw" -i ${cert_file} -d ${cert8} | ||
} | ||
|
||
_del_cert() { | ||
cert_name=$1 | ||
cert_db=$2 | ||
certutil -D -n ${cert_name} -d ${cert8} | ||
} | ||
|
||
_set_cert8() { | ||
if [ "$1" == "iceweasel" ]; then | ||
cert8=$(dirname `find ../ -name "cert8.db" | grep firefox`) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
elif [ "$1" == "icedove" ]; then | ||
cert8=$(dirname `find ../ -name "cert8.db" | grep icedove`) | ||
fi | ||
} | ||
|
||
if [ "$1" == "add" ] && [ $# -eq 4 ]; then | ||
_set_cert8 $2 | ||
cert_file=$3 | ||
cert_name=$4 | ||
_add_cert $cert_file $cert_name | ||
elif [ "$1" == "print" ] && [ $# -eq 2 ]; then | ||
_set_cert8 $2 | ||
_print_certs $cert8 | ||
elif [ "$1" == "del" ] && [ $# -eq 3 ]; then | ||
_set_cert8 $2 | ||
cert_name=$3 | ||
_del_cert $cert_name | ||
else | ||
_help | ||
fi | ||
|
I have some doubts:
../
? Are we in a particular directory? shouldn't the "root" path be/etc/skel/.mozilla/firefox
?