centos6.0下使用samba与XP共享脚本实现

#!/bin/bash
#Program:
# This program is used to samba configuration.
#History:
# 2012/05/03 guobo first relase
read -p "Please input the command(y:mount;n:umount): " yn
if [ "$yn" == "y" ] || [ "$yn" == "Y" ];then
    service smb start
    smbclient -L //192.168.1.101 -U Administrator
    mount -t cifs //192.168.1.101/guobo-share /mnt/samba
fi
if [ "$yn" == "n" ] || [ "$yn" == "N" ];then
    umount /mnt/samba

fi

注:if  [   ]   == 等符号,都需要空格隔开。

你可能感兴趣的:(centos,脚本,command,service,XP,input)