#!/bin/sh
#  $Id: UpgradeFrom_500000.sh 109677 2015-03-31 12:24:31Z pc161604 $
#  Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
#  This software code contains proprietary information 
#  and should be treated as confidential.
#
#  Component: Installation/upgrade
#  Author: Bill Weir

FROM_VERSION=500000 TO_VERSION=510000

. ./util

# handy shortcut vars
TTA="${instdir}/bin/tarantella"
VIN="${instdir}/var/info"
TSR="${instdir}/etc/templates/serverresources"
VSR="${instdir}/var/serverresources"
TSC="${TSR}/serverconfig"
VSC="${instdir}/var/serverconfig"
TSB="${TSC}/global/beans"
VSB="${VSC}/global/beans"
TC="tarantella.config"
T_C="--tarantella-config"

append_property "local/scottawindowsapplication.properties" "${TC}.scottaapplication.scottascriptvars" "TTA_XRANDR=sunsgdxrandr"

# Get config into line with current schema
${TTA} config edit "${T_C}-scottaapplication-scottatransport" "ssh"
${TTA} config edit "${T_C}-security-ciphers" "AES256-SHA"

[ -n "`${TTA} config list \"${T_C}-xpeconfig-keyboard-autorepeat\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-xpeconfig-keyboard-autorepeat" "client"
[ -n "`${TTA} config list \"${T_C}-arraymessage-enabled\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-arraymessage-enabled" "0"
[ -n "`${TTA} config list \"${T_C}-arraymessage-body\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-arraymessage-body" ""
[ -n "`${TTA} config list \"${T_C}-arraymessage-timestamp\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-arraymessage-timestamp" "0"
[ -n "`${TTA} config list \"${T_C}-servermessage-enabled\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-servermessage-enabled" "0"
[ -n "`${TTA} config list \"${T_C}-servermessage-body\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-servermessage-body" ""
[ -n "`${TTA} config list \"${T_C}-servermessage-timestamp\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-servermessage-timestamp" "0"
[ -n "`${TTA} config list \"${T_C}-array-websocketcompression\" | grep ': *not found'`" ] && \
	${TTA} config edit "${T_C}-array-websocketcompression" "all"

exit 0
