====== Différences ====== Ci-dessous, les différences entre deux révisions de la page.
— |
misc:jarsigner-linux [2011/10/31 15:55] (Version actuelle) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | <file bash jarsigner> | ||
+ | #!/bin/bash | ||
+ | # Auto JarSigner | ||
+ | # signs all jars in the current working directory | ||
+ | # CC BY-NC-SA 2.0 | ||
+ | # http://creativecommons.org/licenses/by-nc-sa/2.0/ | ||
+ | # authors : | ||
+ | ## JB (http://www.mrhide.fr) | ||
+ | |||
+ | if [ $# -ne 3 ] | ||
+ | then | ||
+ | echo "${0}, signs all jars in the current working directory" | ||
+ | echo | ||
+ | echo "Usage :" | ||
+ | echo " ${0} <key store> <store pass> <key alias>" | ||
+ | echo " see http://wiki.plexinfo.net/index.php?title=How_to_sign_JAR_files" | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | for file in *.jar | ||
+ | do | ||
+ | echo $file | ||
+ | if [ -w $file ] | ||
+ | then | ||
+ | test=`jarsigner -verify ${file} | grep verified` | ||
+ | if [ ${#test} -eq 0 ] | ||
+ | then | ||
+ | echo " not signed ... signing" | ||
+ | jarsigner -keystore $1 -storepass $2 $file $3 | ||
+ | else | ||
+ | echo " already signed" | ||
+ | fi | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | exit 0 | ||
+ | </file> |