2 Star 6 Fork 5

吉客固件(dugiware)/dugitools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
011.samba_config.sh 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
#作者:DUGIGEEK
#日期:2018.12.08
#描述:samba配置
#使用颜色打印函数
source ~/.colorc
sudo apt-get install samba
if [ $? -eq 0 ]; then
#设定用户
smb_user_name=$(whoami)
#设定需要修改的文件
smb_root_path=/etc/samba/smb.conf
#拷贝配置文件样本
sudo cp z.005.files.samba/smb.conf $smb_root_path
pdone "Copy z.005.files.samba/smb.conf $smb_root_path [OK]"
#修改配置文件中当前用户
sudo sed -i "s#\[dugigeek\]#\[${smb_user_name}\]#g" $smb_root_path
sudo sed -i "s#path=/home/dugigeek#path=/home/${smb_user_name}#g" $smb_root_path
sudo sed -i "s#valid users = dugigeek#valid users = ${smb_user_name}#g" $smb_root_path
sudo sed -i "s#force user = dugigeek#force user = ${smb_user_name}#g" $smb_root_path
sudo sed -i "s#force group = dugigeek#force group = ${smb_user_name}#g" $smb_root_path
sudo smbpasswd -a $(whoami)
sudo chmod 777 /home/${smb_user_name}
pdone "Setup samba [OK]"
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/dugiware/dugitools.git
git@gitee.com:dugiware/dugitools.git
dugiware
dugitools
dugitools
master

搜索帮助