yum-proxy

Thanks for coolmohitz for this idea. Copying this into your /usr/bin directory enables easy proxy authentication for yum without storing your Windows username and password anywhere in .bashrc:


    #!/bin/bash

    if [ "$PROXY" == "" ]
    then
    echo "PROXY environment variable not set. Set it now?"
    read -e -p "proxy address and port: http://" PROXY
    fi

    read -e -p "proxy username: " username
    read -es -p "proxy password: " password
    export http_proxy="http://$username:$password@$PROXY"
    export ftp_proxy="http://$username:$password@$PROXY"

    echo ""
    while [ "$yumcmd" != "exit" ]
    do
    echo "Type yum commands now ('exit' to terminate):"
    read -e -p "(yum) " yumcmd
    if [ "$yumcmd" != "exit" ]
    then
    yum $yumcmd
    fi
    done

To run:


    # yum-proxy

Fill in authentication details, then just type the yum commands you want to issue without the yum, and then type 'exit' to quit, eg.


    (yum) list available
    (yum) update perl
    (yum) exit

Comments

awesome work

this post of yours was fantastic. For somebody who is using YUM for the first time, this is a real magical solution.