Skip to content
Snippets Groups Projects
Commit e17a5118 authored by Vinicius Ruoso's avatar Vinicius Ruoso Committed by Danilo K. S. Yorinori
Browse files

Created a common functions file to client and agent applications


This common functions file will be shared by the agent and client
applications.

The current shared function is getProxyConf(). It will access the
client/conf/proxy file and sets the following proxy variables:
 - phost: the proxy host
 - pport: the proxy port
 - puid: the proxy user name (if authentication is required)
 - ppasswd: the proxy password

Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
Acked-by: default avatarRicardo Tavares de Oliveira <rto07@c3sl.ufpr.br>
Acked-by: default avatarDiego Giovane Pasqualin <dgp06@c3sl.ufpr.br>
Acked-by: default avatarJosiney de Souza <josineys@c3sl.ufpr.br>
Signed-off-by: default avatarDanilo K. S. Yorinori <danilok@c3sl.ufpr.br>
parent 89d36a43
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Copyright (C) 2004-2009 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of client, it is used to store common functions
#
# common.sh is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#------------------------------------------------------------------------------
# function: getProxyConf
# Load the proxy configuration.
function getProxyConf()
{
if ! test -z "${PREFIX}"; then
PROXYCONF="${PREFIX}/client/conf/proxy"
else
PROXYCONF="${dirname}/conf/proxy"
fi
phost=$(grep "^phost=" ${PROXYCONF} | cut -f2 -d=)
pport=$(grep "^pport=" ${PROXYCONF} | cut -f2 -d=)
puid=$(grep "^puid=" ${PROXYCONF} | cut -f2 -d=)
ppasswd=$(grep "^ppasswd=" ${PROXYCONF} | cut -f2 -d=)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment