pulled common upgrade parts for Mint and Ubuntu out to make install scripts not duplicate content

This commit is contained in:
2025-08-16 10:54:36 +10:00
parent ff705095dc
commit 1eb28f6975
4 changed files with 50 additions and 0 deletions

View File

@@ -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

View File

@@ -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

33
upgrade-script-common/ldap-conf Executable file
View File

@@ -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

5
upgrade-script-common/wol Executable file
View File

@@ -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