[ubuntu-us-mi] /etc/cron.daily/apt and proxy

Robert Citek robert.citek at gmail.com
Mon May 18 15:50:49 BST 2009

In Ubuntu 8.10, why is this chunk of code in /etc/cron.daily/apt?

# set the proxy based on the admin users gconf settings
admin_user=$(getent group admin|cut -d: -f4|cut -d, -f1)
if [ -n "$admin_user" ] && [ -x /usr/bin/sudo ] && [ -z "$http_proxy"
] && [ -x /usr/bin/gconftool ]; then
        use=$(sudo -u "$admin_user" gconftool --get
        host=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/host)
        port=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/port)
        if [ "$use" = "true" ] && [ -n "$host" ] && [ -n "$port" ]; then
                export http_proxy="http://$host:$port/"

The two issues I have with it:

1) it ignores any Acquire::http::Proxy setting in a /etc/apt/apt.conf.d/ file
2) it does not handle the case where the proxy is defined by an
Automatic proxy configuration file.

- Robert

More information about the ubuntu-us-mi mailing list