summaryrefslogtreecommitdiff
path: root/smbedit.sh
blob: df3ed1bca72089041e19854bdfc4f2c3cb331c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mkdir -p ~/smb-backups
cp /etc/samba/smb.conf ~/smb-backups/smb_$(date +"%Y%m%d_%H%M").conf
sudo vim /etc/samba/smb.conf

read -r -p "Do you want to restart the smbd daemon? [y/N] " response
case "$response" in
    [yY][eE][sS]|[yY]) 
        sudo systemctl restart smbd
	echo "smbd will restart"
	echo "The old smb.conf file was copied to ~/smb-backups"
        ;;
    *)
        echo "smbd will not restart"
	echo "The old smb.conf file was copied to ~/smb-backups"
        ;;
esac