From c70aac949368e0991b442591931664d9a204da0d Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Mon, 19 Jan 2026 09:12:08 +0000 Subject: [PATCH] dc anhancements, script removal parameter, list outaged repos with wrong codename --- TODO Debian 13 | 1 - install.sh | 30 +++++++++++++++++++----------- outaged_repos | 6 ++++++ src/zmb-ad-join/install-service.sh | 3 +++ src/zmb-ad/install-service.sh | 3 +++ 5 files changed, 31 insertions(+), 12 deletions(-) delete mode 100644 TODO Debian 13 create mode 100644 outaged_repos diff --git a/TODO Debian 13 b/TODO Debian 13 deleted file mode 100644 index ad91e89..0000000 --- a/TODO Debian 13 +++ /dev/null @@ -1 +0,0 @@ -- icinga2 diff --git a/install.sh b/install.sh index 025b69a..f33b216 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,7 @@ usage() { -i CTID provide a container id instead of auto detection -s SERVICE provide the service name and skip the selection dialog -c CFGFILE use a different config file than 'zamba.conf' + -r remove zamba.conf inside container -d Debug mode inside LXC container -h displays this help text --------------------------------------------------------------------------- @@ -39,13 +40,15 @@ ctid=0 service=ask config=$PWD/conf/zamba.conf debug=0 +preserve_install_scripts=1 -while getopts "hi:s:c:d" opt; do +while getopts "hi:s:c:dr" opt; do case $opt in h) usage 0 ;; i) ctid=$OPTARG ;; s) service=$OPTARG ;; c) config=$OPTARG ;; + r) preserve_install_scripts=0 ;; d) debug=1 ;; *) usage 1 ;; esac @@ -189,18 +192,17 @@ sleep 5; pct exec $LXC_NBR -- mkdir -p /root/.ssh pct push $LXC_NBR $LXC_AUTHORIZED_KEY /root/.ssh/authorized_keys pct push $LXC_NBR "$config" /root/zamba.conf +for f in "$PWD/src/functions.sh" "$PWD/src/constants.conf" "$PWD/src/lxc-base.sh" "$PWD/src/$service/install-service.sh" "$PWD/src/$service/constants-service.conf"; do + pct push $LXC_NBR $f /root/$(basename $f) +done + +if [[ $service == "zmb-ad" ]] || [[ $service == "zmb-ad-join" ]]; then + pct push $LXC_NBR scripts/zmb-ad_auto-map-root.sh /root/zmb-ad_auto-map-root.sh + pct push $LXC_NBR scripts/create-service-account /usr/bin/create-service-account +fi + pct exec $LXC_NBR -- sed -i "s,\${service},${service}," /root/zamba.conf pct exec $LXC_NBR -- echo "LXC_NBR=$LXC_NBR" /root/zamba.conf -pct push $LXC_NBR "$PWD/src/functions.sh" /root/functions.sh -pct push $LXC_NBR "$PWD/src/constants.conf" /root/constants.conf -pct push $LXC_NBR "$PWD/src/lxc-base.sh" /root/lxc-base.sh -pct push $LXC_NBR "$PWD/src/$service/install-service.sh" /root/install-service.sh -pct push $LXC_NBR "$PWD/src/$service/constants-service.conf" /root/constants-service.conf - -if [[ $service == "zmb-ad-restore" ]]; then - pct exec $LXC_NBR -- mkdir -p /backup/online - pct push $LXC_NBR "$PWD/samba-backup-*.tar.bz2" /backup/online/ -fi if [ $debug -gt 0 ]; then dbg=-vx; else dbg=""; fi @@ -224,3 +226,9 @@ if [[ $service == "zmb-ad" ]] || [[ $service == "zmb-ad-join" ]]; then sleep 5 pct exec $LXC_NBR /usr/local/bin/smb-backup 7 fi + +if [ $preserve_install_scripts -eq 0 ]; then + for f in constants.conf constants-service.conf functions.sh install-service.sh lxc-base.sh zamba.conf; do + pct exec $LXC_NBR -- if [ -f /root/$f ] ; then rm -f /root/${f} ; fi + done +fi \ No newline at end of file diff --git a/outaged_repos b/outaged_repos new file mode 100644 index 0000000..53b44e4 --- /dev/null +++ b/outaged_repos @@ -0,0 +1,6 @@ +repos ohne debian trixie support +- manticore (fixed via bashclub repo) +- 45drives +- mongodb +- influxdb +- zammad \ No newline at end of file diff --git a/src/zmb-ad-join/install-service.sh b/src/zmb-ad-join/install-service.sh index 8d9a3a0..7878146 100644 --- a/src/zmb-ad-join/install-service.sh +++ b/src/zmb-ad-join/install-service.sh @@ -114,6 +114,9 @@ systemctl unmask samba-ad-dc systemctl enable samba-ad-dc systemctl restart samba-ad-dc +bash /root/zmb-ad_auto-map-root.sh +chmod +x /usr/bin/create-service-account + # configure ad backup cat << EOF > /usr/local/bin/smb-backup #!/bin/bash diff --git a/src/zmb-ad/install-service.sh b/src/zmb-ad/install-service.sh index 6caab2a..2e4476c 100644 --- a/src/zmb-ad/install-service.sh +++ b/src/zmb-ad/install-service.sh @@ -81,6 +81,9 @@ systemctl unmask samba-ad-dc systemctl enable samba-ad-dc systemctl restart samba-ad-dc +bash /root/zmb-ad_auto-map-root.sh +chmod +x /usr/bin/create-service-account + # configure ad backup cat << EOF > /usr/local/bin/smb-backup #!/bin/bash