2021-07-05 06:50:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
r_log "sambsa" "Configure and test samba for a simple share"
|
|
|
|
/bin/cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
|
|
|
|
/bin/cp ./common/files/smb.conf /etc/samba/smb.conf
|
|
|
|
mkdir -p /srv/smb
|
|
|
|
mkdir -p /mnt/smb
|
|
|
|
chcon -R -t samba_share_t /srv/smb
|
|
|
|
|
|
|
|
m_serviceCycler smb restart
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
echo "Obsidian is the Release Name" > /srv/smb/test.txt
|
|
|
|
|
|
|
|
mount -t cifs -o guest,ro //127.0.0.1/rocky /mnt/smb
|
|
|
|
sleep 1
|
|
|
|
|
2021-07-06 20:16:01 +00:00
|
|
|
grep -q "Obsidian" /mnt/smb/test.txt
|
2021-07-05 06:50:25 +00:00
|
|
|
|
|
|
|
ret_val=$?
|
|
|
|
umount /mnt/smb
|
|
|
|
/bin/rm -rf /mnt/smb
|
|
|
|
|
|
|
|
r_checkExitStatus $ret_val
|