updated scripts
This commit is contained in:
@@ -5,7 +5,7 @@ apt-get update
|
||||
apt-get upgrade -y
|
||||
|
||||
# download and install packages
|
||||
apt-get install -y qemu-guest-agent sudo nano curl wget git rsync man-db cifs-utils nfs-common parted libtalloc2 libwbclient0 net-tools gnupg apt-transport-https tmux gdisk bash-completion
|
||||
apt-get install -y qemu-guest-agent sudo nano curl wget zip unzip git rsync man-db cifs-utils nfs-common parted libtalloc2 libwbclient0 net-tools gnupg apt-transport-https tmux gdisk bash-completion
|
||||
|
||||
# add akanealw user if not existing
|
||||
isInFile=$(cat /etc/passwd | grep -c "akanealw")
|
||||
@@ -23,8 +23,6 @@ fi
|
||||
# create akanealw file in /etc/sudoers.d
|
||||
if [[ ! -f /etc/sudoers.d/akanealw ]] ; then
|
||||
echo "akanealw ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/akanealw
|
||||
groupadd sshusers > /dev/null 2>&1
|
||||
usermod -a -G sshusers akanealw > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# enable ping for all users
|
||||
@@ -96,14 +94,10 @@ echo "bind-key C-a send-prefix" >> /etc/tmux.conf
|
||||
# create credentials and map network drives
|
||||
isInFile=$(cat /etc/fstab | grep -c "192.168.1.41")
|
||||
if [ $isInFile -eq 0 ]; then
|
||||
touch /home/akanealw/.smbcreds
|
||||
echo "username=akanealw" >> /home/akanealw/.smbcreds
|
||||
echo "password=8ung1e1!" >> /home/akanealw/.smbcreds
|
||||
chown akanealw:akanealw /home/akanealw/.smbcreds
|
||||
mkdir /mnt/data > /dev/null 2>&1
|
||||
chown akanealw:akanealw /mnt/data
|
||||
echo "# mapped drives" >> /etc/fstab
|
||||
echo "//192.168.1.41/data /mnt/data cifs _netdev,x-systemd.automount,uid=1000,gid=1000,credentials=/home/akanealw/.smbcreds,iocharset=utf8 0 0" >> /etc/fstab
|
||||
mkdir /mnt/truenasdata > /dev/null 2>&1
|
||||
chown akanealw:akanealw /mnt/truenasdata
|
||||
echo "# nfs shares" >> /etc/fstab
|
||||
echo "192.168.1.41:/mnt/data /mnt/truenasdata nfs defaults,nolock,soft,vers=4.2 0 0" >> /etc/fstab
|
||||
fi
|
||||
|
||||
# ask to install samba
|
||||
|
||||
Reference in New Issue
Block a user