Download:
child 5:7b2ad8123a53
parent 3:cb307dcaf2ef
4:2fb825b3c3ef
Anton Shestakov <engored@ya.ru>, Fri, 27 May 2011 21:39:33 +0900
Added .bash_dconf2env: export some useful vars (http_proxy and no_proxy) from dconf config files to environment.

1 файлов изменено, 15 вставок(+), 0 удалений(-) [+]
.bash_dconf2env file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.bash_dconf2env Fri May 27 21:39:33 2011 +0900
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+[[ `type -P dconf` ]] || return
+
+if [[ `dconf read /system/proxy/http/enabled` = "true" ]]; then
+ host=`dconf read /system/proxy/http/host`
+ host="${host//\'/}"
+ port=`dconf read /system/proxy/http/port`
+ export http_proxy="http://${host}:${port}/"
+ export HTTP_PROXY="http://${host}:${port}/"
+
+ no_proxy=`dconf read /system/proxy/ignore-hosts | grep -Po "(?<=')[^']+(?=')" | tr -d ' \n'`
+ export no_proxy="${no_proxy}"
+ export NO_PROXY="${no_proxy}"
+fi