File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- samb是一个linux与windows实现文件共享的一个服务,此安装脚本只支持ubuntu系统,centos待开发 。
1+ samb是一个linux与windows实现文件共享的一个服务,安装脚本支持ubuntu,centos 。
22
33## install
44```
Original file line number Diff line number Diff line change 88# by Ubuntu
99byUbuntu (){
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+
5563echo ' '
5664echo ' +--------------------------------------+'
5765echo ' | ********** install samba ***********|'
You can’t perform that action at this time.
0 commit comments