#!/bin/sh
echo ""
echo "Configuring Samba Server"
echo ""

yum -y install samba

mv /etc/samba/smb.conf /etc/samba/smb.conf.old

cat > /etc/samba/smb.conf <<EOF
[global]
workgroup = workgroup
server string = trixbox PBX
local master = no
domain master = no
preferred master = no
password server = None
guest ok = yes
guest account = root
security = SHARE
dns proxy = no

[share]
path = /
guest ok = yes
writeable = yes
create mask = 0777
EOF

chkconfig --level 345 smb on
/etc/init.d/smb start

echo "Created /etc/samba/smb.conf and set samba to autostart on reboot."
echo "you can edit /etc/samba/smb.conf and add your own options"
echo ""