Skip to content

Commit 20bf197

Browse files
config file bug
1 parent a2bd9cb commit 20bf197

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

setupSamba/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
samb是一个linux与windows实现文件共享的一个服务,此安装脚本只支持ubuntu系统,centos待开发
1+
samb是一个linux与windows实现文件共享的一个服务,安装脚本支持ubuntu,centos
22

33
## install
44
```

setupSamba/install_samba.sh

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
# by Ubuntu
99
byUbuntu(){
1010
echo "byUbuntu"
11-
sudo apt-get update
12-
sudo apt-get install samba
13-
sudo mkdir /srv/shareFile
14-
sudo chmod 777 /srv/shareFile
11+
apt-get update
12+
apt-get install samba
13+
mkdir /srv/shareFile
14+
chmod 777 /srv/shareFile
1515

16-
cp -f ./smb.conf /etc/
17-
sed -i "s/dir/srv\/shareFile/g" /etc/smb.conf
16+
cp -f ./smb.conf /etc/samba/
17+
sed -i "s/dir/srv\/shareFile/g" /etc/samba/smb.conf
1818
cd /srv/shareFile
19-
sudo touch public.txt
19+
touch public.txt
2020
echo "this our share file! andychen (`date`)" > /srv/shareFile/public.txt
2121

22-
sudo sercive smbd restart
22+
sercive smbd restart
2323
echo ''
2424
echo '+--------------------------------------+'
2525
echo '| ********** install samba ***********|'
@@ -36,8 +36,8 @@ byCentos(){
3636
mkdir /srv/shareFile
3737
chmod 777 /srv/shareFile
3838

39-
cp -f ./smb.conf /etc/
40-
sed -i "s/dir/srv\/shareFile/g" /etc/smb.conf
39+
cp -f ./smb.conf /etc/samba/
40+
sed -i "s/dir/srv\/shareFile/g" /etc/samba/smb.conf
4141
cd /srv/shareFile
4242
touch public.txt
4343
echo "this our share file! andychen (`date`)" > /srv/shareFile/public.txt
@@ -52,6 +52,14 @@ byCentos(){
5252
}
5353

5454

55+
# 要求用root用户执行
56+
if [ `whoami` != 'root' ];then
57+
echo "+----------------------------+"
58+
echo "| plase use root user |"
59+
echo "+----------------------------+"
60+
exit 1
61+
fi
62+
5563
echo ''
5664
echo '+--------------------------------------+'
5765
echo '| ********** install samba ***********|'

0 commit comments

Comments
 (0)