From 4d0dcde470116378299175847b5896a0d404178e Mon Sep 17 00:00:00 2001 From: Raine Date: Wed, 18 Oct 2023 22:14:01 +0200 Subject: [PATCH] feat: cifs and stuff --- setup.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index fe610ee..ab3ce3b 100644 --- a/setup.sh +++ b/setup.sh @@ -19,6 +19,8 @@ fi ## MAIN +set -e + if ! [ -f "/etc/ixvd/version" ]; then echo "applying overlay..." cp -r skel / @@ -26,7 +28,7 @@ fi if ! [ -d "/etc/ixvd/secrets" ]; then echo "setting up ixvd/secrets" - git clone git@git.ixvd.net/ixvd/secrets /etc/ixvd/secrets + git clone git@git.ixvd.net:ixvd/secrets /etc/ixvd/secrets fi if ! [ -f "/root/.ssh/authorized_keys" ]; then @@ -38,4 +40,20 @@ else echo "importing authorized_keys..." cat /etc/ixvd/secrets/ssh/authorized_keys >> /root/.ssh/authorized_keys fi +fi + +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<>/etc/fstab +# cifs mount backups +//$domain/backups /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 \ No newline at end of file