removed uneccessary dialogs
This commit is contained in:
@@ -1,24 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ask to install samba
|
||||
if [[ ! -f /etc/samba/smb.conf ]] ; then
|
||||
read -r -p "Install Samba? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]] ; then
|
||||
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
|
||||
if [ $isInFile -eq 0 ]
|
||||
then
|
||||
apt-get install -y samba --no-install-recommends
|
||||
# configure default samba share
|
||||
(echo "8ung1e1!"; sleep 1; echo "8ung1e1!" ) | smbpasswd -s -a akanealw
|
||||
sed -i s/WORKGROUP/akanealw/ /etc/samba/smb.conf
|
||||
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw]")
|
||||
if [ $isInFile -eq 0 ]; then
|
||||
echo "[akanealw]" >> /etc/samba/smb.conf
|
||||
echo " comment = akanealw" >> /etc/samba/smb.conf
|
||||
echo " read only = no" >> /etc/samba/smb.conf
|
||||
echo " path = /home/akanealw" >> /etc/samba/smb.conf
|
||||
echo " guest ok = no" >> /etc/samba/smb.conf
|
||||
echo "" >> /etc/samba/smb.conf
|
||||
fi
|
||||
fi
|
||||
echo "[akanealw]" >> /etc/samba/smb.conf
|
||||
echo " comment = akanealw" >> /etc/samba/smb.conf
|
||||
echo " read only = no" >> /etc/samba/smb.conf
|
||||
echo " path = /home/akanealw" >> /etc/samba/smb.conf
|
||||
echo " guest ok = no" >> /etc/samba/smb.conf
|
||||
echo "" >> /etc/samba/smb.conf
|
||||
systemctl restart smbd
|
||||
systemctl status smbd
|
||||
else
|
||||
echo "Samba is already configured."
|
||||
fi
|
||||
|
||||
systemctl restart smbd
|
||||
systemctl status smbd
|
||||
|
||||
Reference in New Issue
Block a user