From 3ce6d7c2ae321d4fa15efc60f23f29759fb48fbc Mon Sep 17 00:00:00 2001 From: thorstenspille Date: Sun, 29 Oct 2023 22:58:18 +0100 Subject: [PATCH] fix backup, systemd-resolved --- install.sh | 4 ++++ src/zmb-ad/install-service.sh | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index ce499a7..8c556fa 100755 --- a/install.sh +++ b/install.sh @@ -193,3 +193,7 @@ elif [[ $service == "zmb-ad-join" ]]; then pct set $LXC_NBR -nameserver "${LXC_IP%/*} $LXC_DNS" fi pct start $LXC_NBR +if [[ $service == "zmb-ad" ]] || [[ $service == "zmb-ad-join" ]]; then + sleep 5 + pct exec $LXC_NBR /usr/local/bin/smb-backup 7 +fi \ No newline at end of file diff --git a/src/zmb-ad/install-service.sh b/src/zmb-ad/install-service.sh index 13336ff..f4e6e17 100644 --- a/src/zmb-ad/install-service.sh +++ b/src/zmb-ad/install-service.sh @@ -124,7 +124,7 @@ EOF fi # stop + disable samba services and remove default config -systemctl disable --now smbd nmbd winbind systemd-resolved +systemctl disable --now smbd nmbd winbind systemd-resolved > /dev/null 2>&1 rm -f /etc/samba/smb.conf rm -f /etc/krb5.conf @@ -146,10 +146,7 @@ cat << EOF > /usr/local/bin/smb-backup PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin rc=0 -keep=$1 -if \$1 ; then - keep=\$1 -fi +keep=\$1 mkdir -p /${LXC_SHAREFS_MOUNTPOINT}/{online,offline} @@ -198,6 +195,4 @@ cat << EOF > /etc/logrotate.d/smb-backup } EOF -smb-backup 7 - exit 0 \ No newline at end of file