Projet

Général

Profil

« Précédent | Suivant » 

Révision 992f60d0

Ajouté par Renato Botelho il y a plus de 9 ans

Set proxy env vars on interactive shell and also on crontab to make all scripts be able to use it. Ticket #3789

Voir les différences:

etc/inc/services.inc
2272 2272
		$crontab_contents .= "# " .gettext( "Created:") . " " . date("F j, Y, g:i a") . "\n";
2273 2273
		$crontab_contents .= "#\n";
2274 2274

  
2275
		if (isset($config['system']['proxyurl']) && !empty($config['system']['proxyurl'])) {
2276
			$http_proxy = $config['system']['proxyurl'];
2277
			if (isset($config['system']['proxyport']) && !empty($config['system']['proxyport']))
2278
				$http_proxy .= ':' . $config['system']['proxyport'];
2279
			$crontab_contents .= "HTTP_PROXY={$http_proxy}";
2280
		}
2281

  
2275 2282
		foreach ($config['cron']['item'] as $item) {
2276 2283
			$crontab_contents .= "\n{$item['minute']}\t";
2277 2284
			$crontab_contents .= "{$item['hour']}\t";
root/.shrc
1
HTTP_PROXY=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml`
2
if [ "${HTTP_PROXY}" != "" ]; then
3
	HTTP_PROXY_PORT=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml`
4
	if [ "${HTTP_PROXY_PORT}" != "" ]; then
5
		HTTP_PROXY="${HTTP_PROXY}:${HTTP_PROXY_PORT}"
6
	fi
7
	export HTTP_PROXY
8
fi
9

  
1 10
# Detect interactive logins and display the shell
2 11
if [ -n "${SSH_TTY}" -o "${TERM}" = "cons25" ]; then
3 12
	/etc/rc.initial
root/.tcshrc
19 19
	bindkey "\e[7~" beginning-of-line  # Home rxvt/konsole
20 20
	bindkey "\e[8~" end-of-line        # End rxvt/konsole
21 21
endif
22

  
23
set http_proxy=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml`
24
if (${http_proxy} != "") then
25
	set http_proxy_port=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml`
26
	if (${http_proxy_port} != "") then
27
		set http_proxy="${http_proxy}:${http_proxy_port}"
28
	endif
29
	setenv HTTP_PROXY ${http_proxy}
30
endif

Formats disponibles : Unified diff