neb/tools/server-setup.d/30-cifs.sh
2023-10-26 14:30:45 +02:00

17 lines
No EOL
481 B
Bash
Executable file

#!/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
cat<<EOF >>/etc/fstab
# 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