4 # b94923af60a5b4659a8df2847fe1ab6d US_export_policy.jar
5 # 53e2a50065ac6ea39cb2aa7d3975284b local_policy.jar
8 md5_this_uspolicy
=b94923af60a5b4659a8df2847fe1ab6d
9 md5_this_localpolicy
=53e2a50065ac6ea39cb2aa7d3975284b
10 jcedir
=/usr
/share
/java
/java-jce_ustrength
11 jresecuritydir
=/opt
/java
/jre
/lib
/security
12 _ext
=java-jce_ustrength.backup
17 if [ ${UID} -eq 0 ]; then
23 # 0 = Unlimited Strength JCE Policy already installed
24 # 1 = Original JCE Policy installed
25 # 2 = Destination files don't exist
26 check_destinationfiles
(){
27 if [ ! -e "${jresecuritydir}/US_export_policy.jar" -o ! -e "${jresecuritydir}/local_policy.jar" ];
31 md5_uspolicy
=$
(md5sum ${jresecuritydir}/US_export_policy.jar | cut
-d " " -f 1)
32 md5_localpolicy
=$
(md5sum ${jresecuritydir}/local_policy.jar | cut
-d " " -f 1)
33 if [ "${md5_uspolicy}" == "${md5_this_uspolicy}" -a \
34 "${md5_localpolicy}" == "${md5_this_localpolicy}" ]; then
41 check_destinationfiles
43 if [ "${not_installed}" -eq "1" ]; then
46 if [ "${isroot}" -eq "0" ]; then
47 echo "You must be root for doing this operation."
50 echo -n "Installing Unlimited Strength JCE files..."
51 cp ${jresecuritydir}/US_export_policy.jar ${jresecuritydir}/US_export_policy.jar.${_ext} ||
return 1
52 cp ${jresecuritydir}/local_policy.jar ${jresecuritydir}/local_policy.jar.${_ext} ||
return 1
53 cp ${jcedir}/US_export_policy.jar
${jresecuritydir}/ ||
return 1
54 cp ${jcedir}/local_policy.jar
${jresecuritydir}/ ||
return 1
57 echo "Unlimited Strength JCE files already installed."
62 check_destinationfiles
64 if [ "$not_installed" -eq "0" ]; then
67 if [ "${isroot}" -eq "0" ]; then
68 echo "You must be root for doing this operation."
71 echo -n "Uninstalling Unlimited Strength JCE files..."
72 if [ ! -e "${jresecuritydir}/US_export_policy.jar.${_ext}" -a \
73 ! -e "${jresecuritydir}/local_policy.jar.${_ext}" ]; then
74 echo "Previous backup of the files doesn't exist!"
75 echo "For uninstall, reinstall the jre package."
79 mv ${jresecuritydir}/US_export_policy.jar.${_ext} ${jresecuritydir}/US_export_policy.jar ||
return 1
80 mv ${jresecuritydir}/local_policy.jar.${_ext} ${jresecuritydir}/local_policy.jar ||
return 1
83 if [ -e "${jresecuritydir}/US_export_policy.jar.${_ext}" -a \
84 -e "${jresecuritydir}/local_policy.jar.${_ext}" ]; then
87 if [ "${isroot}" -eq "0" ]; then
88 echo "You must be root for doing this operation."
91 echo -n "Deleting old regular JCE files backup..."
92 rm ${jresecuritydir}/US_export_policy.jar.
${_ext} ||
return 1
93 rm ${jresecuritydir}/local_policy.jar.
${_ext} ||
return 1
97 if [ "${not_installed}" -eq "1" ]; then
98 echo "Regular JCE files already installed."
108 *) echo "Usage $0: {install|uninstall}"