source: n4d-proxy/trunk/fuentes/scripts/proxy-client/proxy-client-vars @ 229

Last change on this file since 229 was 229, checked in by hectorgh, 4 years ago

adding project files

  • Property svn:executable set to *
File size: 689 bytes
Line 
1#!/bin/sh
2
3set -e
4
5# main
6[ "$1" = "pre-cpkg" ] || exit 0
7
8# read vars
9VAR_LIST="PROXY_HOST PROXY_HTTP_PORT PROXY_PATH"
10eval `/usr/sbin/llxcfg-showvars ${VAR_LIST}`
11
12# calculate vars
13PROXY_ENABLED="false"
14PROXY_MODE="none"
15PROXY_AUTOCONFIG_URL=""
16if [ "$PROXY_HOST" -a "$PROXY_HTTP_PORT" ] ; then
17   PROXY_ENABLED="true"
18   if [ "$PROXY_PATH" ] ; then
19      PROXY_MODE="auto"
20      PROXY_AUTOCONFIG_URL="http://${PROXY_HOST}/${PROXY_PATH}/proxy.pac"
21   else
22      PROXY_MODE="manual"
23   fi
24fi
25
26# generate vars
27llxcfg-systemvars add PROXY_ENABLED="$PROXY_ENABLED" \
28                      PROXY_MODE="$PROXY_MODE" \
29                      PROXY_AUTOCONFIG_URL="$PROXY_AUTOCONFIG_URL"
30
31exit 0
Note: See TracBrowser for help on using the repository browser.