LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   error using samba (https://www.linuxquestions.org/questions/programming-9/error-using-samba-512821/)

Yasir Sualeh 12-22-2006 04:20 AM

error using samba
 
writing a shell scipt on bash:

[ysm@edb ~]$ vi smb.sh
# Verify Availability
#WINHOST=YasirSualeh
#CONNECT=$(echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M $WINHOST)


if echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M YasirSualeh | grep -q "Connected"
then
echo "Well connected."
else
echo "Oops, Not Connected."
fi



it works well if there is a hard code server name (see if condition)
but once i add a variable(WINHOST) in place of server name it does not send message. any hint?

jakev383 12-22-2006 07:25 AM

Quote:

Originally Posted by Yasir Sualeh
writing a shell scipt on bash:

[ysm@edb ~]$ vi smb.sh
# Verify Availability
#WINHOST=YasirSualeh
#CONNECT=$(echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M $WINHOST)


if echo "Testing SAMBA Connectivity for $WINHOST " | smbclient -M YasirSualeh | grep -q "Connected"
then
echo "Well connected."
else
echo "Oops, Not Connected."
fi



it works well if there is a hard code server name (see if condition)
but once i add a variable(WINHOST) in place of server name it does not send message. any hint?

Maybe use backticks to expand the variable?


All times are GMT -5. The time now is 04:36 PM.