1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

anyone wanna help with a bash script ??

Discussion in 'Computers, Games, Electronics etc' started by CRX-YEM, Mar 23, 2006.

  1. CRX-YEM

    CRX-YEM Super Moderator Moderator VIP

    Messages:
    4,623
    Likes Received:
    54
    Joined:
    Sep 29, 2002
    Location:
    Wallingford, CT
    Code:
    #! /bin/bash
    
    #variables
    AP='YEM_WAP_secured'
    TAP=$(iwgetid -r)
    UNAME=$(uname -n)
    #end variables
    
    #make sure we're connected to users home access point,
    #if not don't mount shares, echo -e to use \characters
    if [ $AP = $TAP ]; then
     echo "Good we're connected to $USER's home AP"
     echo "$UNAME: will now attempt to map $USER's home shares" 
     sudo mount -a
    else
     echo "$UNAME: will not map $USER's home shares" 
     echo "ESSID does not match $USER's home 'AP'" 
    fi
    exit 
    ok this works, but I need to be root, so, that's a problem , anyone no a way to pass a password without user intervention to sudo ??
     
Verification:
Draft saved Draft deleted

Share This Page