neb/tools/server-setup.d/30-cifs.sh

17 lines
481 B
Bash
Raw Normal View History

2023-10-20 00:10:39 +02:00
#!/bin/sh
if ! grep -q "# cifs mount backups" /etc/fstab; then
echo "modifying fstab..."
cp /etc/fstab /etc/fstab.$(date +"%H-%M-%S_%d-%m-%y").bak
. /etc/ixvd/secrets/backups.cifs
2023-10-26 14:30:45 +02:00
cat<<EOF >>/etc/fstab
2023-10-20 00:10:39 +02:00
# cifs mount backups
//$domain/backup /mnt/backups cifs credentials=/etc/ixvd/secrets/backups.cifs,file_mode=0777,dir_mode=0777,noperm 0 0
EOF
fi
if ! [ -d "/mnt/backups" ]; then
echo "mounting share..."
mkdir /mnt/backups
mount /mnt/backups
fi