anyone wanna help with a bash script ??

We may earn a small commission from affiliate links and paid advertisements. Terms

CRX-YEM

Super Moderator
Moderator
VIP
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 ??
 
Back
Top