Here is a script to switch the proxy on/off with an optional host and port.
#! /bin/sh
# Switches the GNOME proxy on/off and
# can take an optional proxy host+port
usage ()
{
cat << CAT
Usage: `basename $0` on|off [host [port]]
CAT
exit 1
}
[ $# -lt 1 ] && usage
case "$1" in
"on")
mode="manual"
;;
"off")
mode="none"
;;
*)
usage
;;
esac
gconftool-2 -t string -s /system/proxy/mode "$mode"
[ ! -z "$2" ] && \
gconftool-2 -t string -s /system/http_proxy/host "$2"
[ ! -z "$3" ] && \
gconftool-2 -t int -s /system/http_proxy/port "$3"
As usual you can follow the changes at mykey57.free.fr/pub/misc/bin/.
Enjoy!
No comments:
Post a Comment