#!/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} " 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