Comment 7 for bug 13661

Revision history for this message
Fabrizio Balliano (fabrizio-balliano) wrote : Re: get proxy via gconf

a simple script to detect proxy and export http_proxy, it can be used by root
when the gnome desktop is running (I know the w|grep is not beauty but it's the
only way I found at the moment)

----------------------
#!/bin/bash

U=`w|grep x-session-manag| awk '{print $1}'`

if `su $U -c 'gconftool -g /system/http_proxy/use_http_proxy'`; then
        HOST=`su $U -c 'gconftool -g /system/http_proxy/host'`
        PORT=`su $U -c 'gconftool -g /system/http_proxy/port'`
        USER=""
        PASS=""

        if `su $U -c 'gconftool -g /system/http_proxy/use_authentication'`; then
                USER=`su $U -c 'gconftool -g
/system/http_proxy/authentication_user'`
                PASS=`su $U -c 'gconftool -g
/system/http_proxy/authentication_password'`
        fi

        export http_proxy="http://$USER:$PASS@$HOST:$PORT"
fi
----------------------