#!/bin/bash # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 ("License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.zimbra.com/license # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is: Zimbra Collaboration Suite Server. # # The Initial Developer of the Original Code is Zimbra, Inc. # Portions created by Zimbra are Copyright (C) 2005, 2006 Zimbra, Inc. # All Rights Reserved. # # Contributor(s): # # ***** END LICENSE BLOCK ***** # ln -s /opt/zimbra/libexec/zmgenentitlement /etc/conary/entitlements/products.rpath.com cat > /opt/zimbra/libexec/zmgenentitlement << ENTITLEMENTS #!/bin/bash # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 ("License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.zimbra.com/license # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # The Original Code is: Zimbra Collaboration Suite Server. # # The Initial Developer of the Original Code is Zimbra, Inc. # Portions created by Zimbra are Copyright (C) 2006 Zimbra, Inc. # All Rights Reserved. # # Contributor(s): # # ***** END LICENSE BLOCK ***** # # look for the entitlement data from the ZCS license license=/opt/zimbra/conf/ZCSLicense.xml if ! [ -f "\$license" ]; then echo "error: unable to read license information" > /dev/stderr exit 1 fi # pull the license UUID from the license file key=\$(cat \$license | grep LicenseId | awk -F= '{print \$NF}' | awk -F\" '{print \$2}') # calculate how we were called (e.g. /etc/conary/entitlements/conary.rpath.com) server=\$(basename \$0) case \$server in products.rpath.com) class=zimbra-zcs ;; conary.rpath.com) class=zimbra-zcs ;; zimbra.liquidsys.com) class=zimbra-zcs ;; *) echo "error: script was called as \$0. it should only be called via a symlink that matches the server nam e" exit 1 ;; esac cat << EOF ]> \$server \$class \$key EOF ENTITLEMENTS echo "Download and package installation errors will be logged to /tmp/update.log" echo -n "Downloading and Applying updates..." conary update conary >> /tmp/update.log 2>&1 conary update group-dist=zimbra.liquidsys.com@zimbra:zcs/0.2-0.0.7-8 --replace-files >> /tmp/update.log 2>&1 echo "done." if [ $? = 0 ]; then /opt/zimbra/libexec/zmsetup.pl fi /etc/init.d/raa restart