Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -lt 2 ]; then
- echo "pass share dir and share name"
- exit -1
- fi
- i=$( whoami )
- if [ "$i" != "root" ]; then
- echo "you need to be root to run this script"
- exit -1
- fi
- share_dir=$1
- share_name=$2
- if [ ! -d $share_dir ]; then
- mkdir $share_dir
- fi
- echo -e "[$share_name]\nwritable = yes\npath = $share_dir\nguest ok = yes\nforce group = nogroup\nforce user = nobody\n" >> /etc/samba/smb.conf
- chown nobody:nogroup $share_dir
- chmod a+rwx $share_dir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement