#!/bin/sh
. /etc/functions.sh

unset PKG_SERVER

config_cb() {
	local cfg="$CONFIG_SECTION"
	local cfgtype
	[ -n "$PKG_SERVER" ] && return
	config_get cfgtype "$cfg" TYPE

	case "$cfgtype" in
		pkgserver)
			config_get hostname	$cfg hostname
			#config_get port		$cfg port
			[ -z "$hostname" ] && return
			wget -O /tmp/vigor.txt "$hostname"vigor.txt >/dev/null && { PKG_SERVER=$hostname; }
		;;
	esac
}
config_load vigorcode 
[ -z "$PKG_SERVER" ] && { PKG_SERVER=http://vigor2130.googlecode.com/files/; }
logger "Download file from $PKG_SERVER."