From 1eb28f697518047509af67028493c01e67e40d70 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 16 Aug 2025 10:54:36 +1000 Subject: [PATCH] pulled common upgrade parts for Mint and Ubuntu out to make install scripts not duplicate content --- upgrade-script-common/delete-pkgs | 6 ++++++ upgrade-script-common/fix-fstab | 6 ++++++ upgrade-script-common/ldap-conf | 33 +++++++++++++++++++++++++++++++ upgrade-script-common/wol | 5 +++++ 4 files changed, 50 insertions(+) create mode 100755 upgrade-script-common/delete-pkgs create mode 100755 upgrade-script-common/fix-fstab create mode 100755 upgrade-script-common/ldap-conf create mode 100755 upgrade-script-common/wol diff --git a/upgrade-script-common/delete-pkgs b/upgrade-script-common/delete-pkgs new file mode 100755 index 0000000..dbaa25e --- /dev/null +++ b/upgrade-script-common/delete-pkgs @@ -0,0 +1,6 @@ +#!/bin/bash + +apt-get -y purge modemmanager +apt-get -y purge avahi-daemon +apt-get -y purge speech-dispatcher +apt-get -y autoremove diff --git a/upgrade-script-common/fix-fstab b/upgrade-script-common/fix-fstab new file mode 100755 index 0000000..a4e9ca2 --- /dev/null +++ b/upgrade-script-common/fix-fstab @@ -0,0 +1,6 @@ +#!/bin/bash + +OD=$1 +# FIX /etc/fstab (likely this would work) -- relies on you already having installed with /home AND UUID/mount options not changing +grep '/export' $OD/etc/fstab >> /etc/fstab +grep '/backup' $OD/etc/fstab >> /etc/fstab diff --git a/upgrade-script-common/ldap-conf b/upgrade-script-common/ldap-conf new file mode 100755 index 0000000..89456d4 --- /dev/null +++ b/upgrade-script-common/ldap-conf @@ -0,0 +1,33 @@ +#!/bin/bash + +# set up defaults for using ldap (pre-answering ldap-auth-config) +echo "ldap-auth-config ldap-auth-config/ldapns/ldap-server string ldap://192.168.2.2" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/ldapns/base-dn string dc=depaoli,dc=id,dc=au" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/ldapns/ldap_version select 3" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/dbrootlogin boolean true" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/dblogin boolean false" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/ldapns/base-dn string dc=depaoli,dc=id,dc=au" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/rootbinddn string cn=admin,dc=depaoli,dc=id,dc=au" | debconf-set-selections +echo "ldap-auth-config ldap-auth-config/rootbindpw string a_real_admin_pass_word_for_2o20" | debconf-set-selections + +sudo apt install libnss-ldap libpam-ldap ldap-utils nscd + +# make system use ldap for users / groups +sed -i -e s"/passwd: files/passwd: files systemd ldap/" /etc/nsswitch.conf +sed -i -e s"/group: files/group: files systemd ldap/" /etc/nsswitch.conf + +# test this +echo 'pam-auth-update pam-auth-update/enable_mkhomedir boolean true' | sudo debconf-set-selections +sudo DEBIAN_FRONTEND=noninteractive pam-auth-update ; # tick on home dir creation + +# add bind_policy soft to /etc/ldap.conf (as root) +echo "bind_policy soft" >> /etc/ldap.conf + +# OLD WAY: answer: +#1) ldap://192.168.2.2 +#2) dc=depaoli,dc=id,dc=au +#3) 3 +#4) Yes +#5) No +#6) cn=admin,dc=depaoli,dc=id,dc=au +#7) a_real_admin_pass_word_for_2o20 diff --git a/upgrade-script-common/wol b/upgrade-script-common/wol new file mode 100755 index 0000000..0e83fbc --- /dev/null +++ b/upgrade-script-common/wol @@ -0,0 +1,5 @@ +#!/bin/bash + +# ensure wol works in new systemd world +conn=`nmcli -t -f NAME,TYPE connection show | grep ethernet | cut -f1 -d:` +sudo nmcli c modify "$conn" 802-3-ethernet.wake-on-lan magic