From 0b13f19f8464e4698b57111e4269d9fb491c2be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 09:43:40 +0200 Subject: [PATCH 01/14] logon_script: Only Snc Mozilla if the Options are set in config. --- system_setup/logon_script.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index 756d415..4851ecb 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -135,8 +135,15 @@ fi elog_add "" #SYNC Firefox + Thunderbird Profile -${SYSCONFIGPATH}/system_setup/mozilla_starter.sh firefox sync && ${SYSCONFIGPATH}/system_setup/mozilla_starter.sh thunderbird sync -elog_add "Successfully synced Mozilla profiles (log in another file)." +if [ ! -z "${PROFILE_FIREFOX_SRC}"]; then + ${SYSCONFIGPATH}/system_setup/mozilla_starter.sh firefox sync +fi +if [ $? -eq 0 ] && [ ! -z "${PROFILE_TB_SRC}"]; then + ${SYSCONFIGPATH}/system_setup/mozilla_starter.sh thunderbird sync + if [ $? -eq 0 ]; then + elog_add "Successfully synced Mozilla profiles (log in another file)." + fi +fi elog_add "Sucessfully run logon script (Wait 3 seconds)" sleep 3 From 1495c57a998cf30edc2d9b6d27061066d8fcd93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 10:42:34 +0200 Subject: [PATCH 02/14] Obsoleted client_software/install.sh and user_run.sh To make structure of client_software more clear for following introduction of client_software.2nd --- client_software/install.sh | 53 +++++------------------------------- client_software/user_run.sh | 45 +++++------------------------- config.d/README.md | 4 +-- system_setup/logon_script.sh | 49 +++++++++++++++++++++++++-------- 4 files changed, 54 insertions(+), 97 deletions(-) diff --git a/client_software/install.sh b/client_software/install.sh index 843ebe0..0904c29 100755 --- a/client_software/install.sh +++ b/client_software/install.sh @@ -2,51 +2,12 @@ # SPDX-FileCopyrightText: Daniel Pätzold # SPDX-License-Identifier: AGPL-3.0-or-later # -# Central sofwareinstallation script. Should be called from ""/sys_config/system_setup/sync_client_software.sh install" -# If P1 is given, only installs will be executed, that are containing the P1 string in their dirname +# Obsolete Script +# Will get removed completely, its only here to advise the user to update and rerun the logon_script # -if [ "$EUID" -ne 0 ] || [ "$SUDO_USER." == "." ]; then - echo "Error: Script requires root privileges and a sudo environment." - exit 1 -fi -#Check Token -if [ "${DAVTOKEN_USER}." == "." ]; then - echo "Error: Script cannot be executed standalone and needs a prereserved environement from logon-script." - echo "To get executed without password prompt, use the NOPASSWD rule in sudo. In FreeIPA you can use the sudo-option !authenticate in the sudo rule." - echo "Additionally add the sudo command to the rule: ^\/sys_config\/system_setup\/sync_client_software\.sh.*$" - echo "Press any key to continue" && read -n 1 -s -r && exit 1 -fi - -echo "Installing additional Software." -for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" -do - DIR=${DIR%*/} # remove the trailing "/" - if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then - #search for string in dir - echo "Skipping ${DIR} while not in search parameter ( $1 )." - continue - fi - if [ -f "${DIR}/install.sh" ]; then - echo "*** ==================== ***" - echo "*** Installing ${DIR##*/} ***" # print everything after the final "/" - cd ${DIR} - ${DIR}/install.sh - if [ $? -ne 0 ]; then - echo "*** ==================== ***" - echo "Some Error in script, will not continue. Please check." - echo "Press any key to continue." - read -n 1 -s -r - cd ${SCRIPTPATH} - exit 1 - fi - echo "*** ==================== ***" - fi -done -cd ${SCRIPTPATH} - -#Last, remove unused Flatpak- Runtimes and unused Data -echo "Removing unused Flatpak- Data." -flatpak uninstall --unused -y -su -c "flatpak uninstall --delete-data -y" $SUDO_USER -echo "Sucessfully Installed Software." +echo " ==================== " +echo "Obsolete Script $0 called. Please update via git (should have been done already, check above!) and rerun the logon_script by relogon again." +echo "This Message should disappear then. Press any key to continue." +read -n 1 -s -r +exit 1 diff --git a/client_software/user_run.sh b/client_software/user_run.sh index bfc7275..0904c29 100755 --- a/client_software/user_run.sh +++ b/client_software/user_run.sh @@ -2,43 +2,12 @@ # SPDX-FileCopyrightText: Daniel Pätzold # SPDX-License-Identifier: AGPL-3.0-or-later # -# Running user scripts after install (as user, not root) -# If P1 is given, only scripts will be executed, that are containing the P1 string in their dirname +# Obsolete Script +# Will get removed completely, its only here to advise the user to update and rerun the logon_script # -#Check Token -if [ "${DAVTOKEN_USER}." == "." ]; then - echo "Error: Script cannot be executed standalone and needs a prereserved environement from logon-script." - echo "Press any key to continue" && read -n 1 -s -r && exit 1 -fi - -echo "Running user scripts in software." -for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" -do - DIR=${DIR%*/} # remove the trailing "/" - if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then - #search for string in dir - echo "Skipping ${DIR} while not in search parameter ( $1 )." - continue - fi - if [ -f "${DIR}/user_run.sh" ]; then - echo "*** ==================== ***" - echo "*** Running ${DIR##*/} ***" # print everything after the final "/" - cd ${DIR} - ${DIR}/user_run.sh - if [ $? -ne 0 ]; then - echo "*** ==================== ***" - echo "Some Error in script, will not continue. Please check." - echo "Press any key to continue." - read -n 1 -s -r - cd ${SCRIPTPATH} - exit 1 - fi - echo "*** ==================== ***" - fi -done -echo "Completed user scripts in software." - -cd ${SCRIPTPATH} -exit 0 - +echo " ==================== " +echo "Obsolete Script $0 called. Please update via git (should have been done already, check above!) and rerun the logon_script by relogon again." +echo "This Message should disappear then. Press any key to continue." +read -n 1 -s -r +exit 1 diff --git a/config.d/README.md b/config.d/README.md index 80cea40..cf8762e 100644 --- a/config.d/README.md +++ b/config.d/README.md @@ -1,4 +1,4 @@ # Local config Files -You may have .conf files in here, which will be not be touched by anything and will be sourced by the scripts to overwrite any of the settings in setup_system.conf.dist -The syntax should be same as setup_system.conf.dist +You may have SYSTEM specific .conf files in here, which will be not be touched by anything and will be sourced by the scripts to overwrite any of the settings in setup_system.conf.dist. +Don't use this folder for special settings of your company. It is only for the PC itself if it is configured in another way as all others. The syntax should be same as setup_system.conf.dist diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index 4851ecb..f1ade3a 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # SPDX-FileCopyrightText: Daniel Pätzold # SPDX-License-Identifier: AGPL-3.0-or-later # @@ -57,8 +57,9 @@ fi # Mount the private Directory elog_add_command "${SYSCONFIGPATH}/system_setup/mount_ecrypt_home.sh" if [ $? -ne 0 ]; then - elog_add "Some Error when mounting private Directory, cannot continue. Your Data will not be available." - elog_add "The script was searched by SYSCONFIGPATH in directory ${SYSCONFIGPATH}, please check if your setup is correct." + elog_add "Some Error when running/mounting private Directory, cannot continue. Your Data will not be available." + elog_add "If the File was not found: The mount script was searched in directory ${SYSCONFIGPATH} which is defined by SYSCONFIGPATH in your config." + elog_add "Please check if your setup is correct." elog_add "If you want to redo this script here, execute ${SCRIPTPATH}/${SCRIPTNAME}" echo "Press any key to continue" && read -n 1 -s -r && exit 1 fi @@ -66,7 +67,7 @@ fi #Get WEBDAV TOKEN from Nextcloud get_nc_token if [ $? -ne 0 ]; then - elog_add "Some Error when mounting private Directory, cannot continue. Your Data will not be available." + elog_add "Some Error when getting WEBDAV token. Cannot continue. Your Data will not be available." echo "Press any key to continue" && read -n 1 -s -r && exit 1 fi elog_add "Successfully obtained Token for User ${DAVTOKEN_USER}" @@ -125,20 +126,46 @@ else fi fi fi -echo "" #Anyway run user scripts if existent -elog_add_command "${CLIENT_SOFTWARE_DST}/user_run.sh $1" -if [ $? -ne 0 ]; then - exit 1 -fi +#elog_add_command "${CLIENT_SOFTWARE_DST}/user_run.sh $1" +elog_add "Running all software scripts in user- context." +#1. Run the scripts, that are delivered by the package maintainers +for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" +do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + elog_add "Skipping ${DIR} while not in search parameter ( $1 )." + continue + fi + if [ -f "${DIR}/user_run.sh" ]; then + elog_add " >>> Running ${DIR}/user_run.sh" + cd ${DIR} + elog_add_command "${DIR}/user_run.sh" + if [ $? -ne 0 ]; then + elog_add " ====================" + elog_add "Some Error in script, will not continue. Please check." + elog_add "Press any key to continue." + read -n 1 -s -r + cd ${SCRIPTPATH} + exit 1 + fi + elog_add " ====================" + fi +done +elog_add "Completed user scripts in software." elog_add "" +# Remove unused flatpak user installed software and data +flatpak uninstall --unused -y --user +flatpak uninstall --delete-data -y + #SYNC Firefox + Thunderbird Profile -if [ ! -z "${PROFILE_FIREFOX_SRC}"]; then +if [ ! -z "${PROFILE_FIREFOX_SRC}" ]; then ${SYSCONFIGPATH}/system_setup/mozilla_starter.sh firefox sync fi -if [ $? -eq 0 ] && [ ! -z "${PROFILE_TB_SRC}"]; then +if [ $? -eq 0 ] && [ ! -z "${PROFILE_TB_SRC}" ]; then ${SYSCONFIGPATH}/system_setup/mozilla_starter.sh thunderbird sync if [ $? -eq 0 ]; then elog_add "Successfully synced Mozilla profiles (log in another file)." From 10517de84e91972db74b7e401ad95742305a5904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 10:48:48 +0200 Subject: [PATCH 03/14] Obsolete client_software/install.sh --- system_setup/sync_client_software.sh | 35 +++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 098c2df..bf19ba3 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -165,13 +165,36 @@ else find ${CLIENT_SOFTWARE_DST} -type f -name install.sh -exec chmod ugo+x {} \; #Run Software setup - echo "Running Setup of Software" - if [ $1 == "install" ]; then - ${CLIENT_SOFTWARE_DST}/install.sh $2 - if [ $? -ne 0 ]; then - exit 1 + echo "Running all software scripts in admin- context." + for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" + do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + echo "Skipping ${DIR} while not in search parameter ( $1 )." + continue fi - fi + if [ -f "${DIR}/install.sh" ]; then + echo " ====================" + echo " >>> Running ${DIR}/install.sh" + cd ${DIR} + ${DIR}/install.sh + if [ $? -ne 0 ]; then + echo " ====================" + echo "Some Error in script, will not continue. Please check." + echo "Press any key to continue." + read -n 1 -s -r + exit 1 + fi + echo " ====================" + fi + done + + #Last, remove unused Flatpak- Runtimes and unused Data + echo "Removing unused Flatpak- Data." + flatpak uninstall --unused -y + + echo "Sucessfully installed software." fi echo "" exit 0 From 84527d63842b238579e9e82c45a2019d48666e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:07:54 +0200 Subject: [PATCH 04/14] client_software cosmetic changes --- client_software/0010_kwallet/install.sh | 4 ++-- client_software/0010_kwallet/user_run.sh | 7 +++++++ client_software/0110_nextcloud_talk_app/install.sh | 8 +++++++- client_software/README.md | 12 +++++++----- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/client_software/0010_kwallet/install.sh b/client_software/0010_kwallet/install.sh index 683f850..0e6bb42 100755 --- a/client_software/0010_kwallet/install.sh +++ b/client_software/0010_kwallet/install.sh @@ -18,13 +18,13 @@ echo "Setup KWallet Password- Service." #Check for root if [ "$EUID" -ne 0 ]; then - echo "Error: Script requires root. Please check if ${SCRIPTPATH}/${SCRIPTNAME} is in sudoers rules and if you are a member. And if executed via sudo." + echo "Error: Script requires root." exit 1 fi #Check Token if [ "${DAVTOKEN_USER}." == "." ]; then - echo "Error: Script cannot be executed standalone and needs a prereserved Environment. Quit." + echo "Error: Script cannot be executed standalone and needs a prereserved environment from sync_client_software.sh. Quit." exit 1 fi diff --git a/client_software/0010_kwallet/user_run.sh b/client_software/0010_kwallet/user_run.sh index d8ccbcd..0cc2ede 100755 --- a/client_software/0010_kwallet/user_run.sh +++ b/client_software/0010_kwallet/user_run.sh @@ -1,6 +1,13 @@ #!/bin/bash # Restart and test Kwallet- Service +#Check Token +if [ "${DAVTOKEN_USER}." == "." ]; then + echo "Error: Script cannot be executed standalone and needs a prereserved environment from sync_client_software.sh. Quit." + exit 1 +fi + + # Vars WALLETAPPID="sys_config_wallet_script" WALLETNAME="kdewallet" diff --git a/client_software/0110_nextcloud_talk_app/install.sh b/client_software/0110_nextcloud_talk_app/install.sh index f0127b8..136774b 100755 --- a/client_software/0110_nextcloud_talk_app/install.sh +++ b/client_software/0110_nextcloud_talk_app/install.sh @@ -7,7 +7,13 @@ #Check for root if [ "$EUID" -ne 0 ]; then - echo "Error: Script requires root. Please check if ${SCRIPTPATH}/${SCRIPTNAME} is in sudoers rules and if you are a member. And if executed via sudo." + echo "Error: Script requires root." + exit 1 +fi + +#Check Token +if [ "${DAVTOKEN_USER}." == "." ]; then + echo "Error: Script cannot be executed standalone and needs a prereserved environment from sync_client_software.sh. Quit." exit 1 fi diff --git a/client_software/README.md b/client_software/README.md index 20b2f74..b58d0ef 100644 --- a/client_software/README.md +++ b/client_software/README.md @@ -1,7 +1,9 @@ -Central Software installation script Repository -Must be executed from script ../sync_client_software.sh +# Pre installed software installation script repository -The install script here will check for the right environment, and execute the install.sh script in each directory. +Contains Packages to install and setup at user logon first. +Each package is in one directory and may include two scripts which will be called from user logon script: -Be sure to name the directories to get sorted the right way. -E.g. you may use all base installations with directories beginning with numbers < 0100 and all additional apps with numbers > 0100 +- install.sh - will be called with root- privileges to install software or other administrative tasks +- user_run.sh - will get executed after all admins scripts had been executed in user context to setup user configs ad data + +The execution will be sorted by directory name. From a237f58813d70dbd97fcdc70289b7863dc57ff39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:10:19 +0200 Subject: [PATCH 05/14] Introduce client_software_cust For customer setups, the software repository was split into client_software and client_software_cust. Obsoleted sync for client_software. --- .gitignore | 10 ++- client_software_cust/README.md | 14 ++++ .../config.dist/setup_system.conf.dist | 9 +- system_setup/logon_script.sh | 43 +++++++++- system_setup/sync_client_software.sh | 82 +++++++++++++------ 5 files changed, 125 insertions(+), 33 deletions(-) create mode 100644 client_software_cust/README.md diff --git a/.gitignore b/.gitignore index b617e87..f9553e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,14 @@ .Trash* *.kdev4 .kdev4/* -client_software/.sync_*.db -client_software/setup_system.conf +ks_pc_prof/* +ks.cfg config/* !config/README.md config.d/*.conf config.d/*.sys config.d/*.bak -ks_pc_prof/* -ks.cfg +client_software/.sync_*.db +client_software/setup_system.conf +client_software_cust/* +!client_software_cust/README.md diff --git a/client_software_cust/README.md b/client_software_cust/README.md new file mode 100644 index 0000000..d5e8be2 --- /dev/null +++ b/client_software_cust/README.md @@ -0,0 +1,14 @@ +# Companys Software Repository + +This Repository contains the software of you company, which is delivered by your company admins. +All files here despite this README ar not traked by git and are not part of installation packages. +Your Company is completely free to add files to it. +Your Company is encouraged to setup its own git repository + +The scripts will be run at logon time after the scripts of the predefined software has been installed. +Each package is in one directory and may include two scripts which will be called from user logon script: + +- install.sh - will be called with root- privileges to install software or other administrative tasks +- user_run.sh - will get executed after all admins scripts had been executed in user context to setup user configs ad data + +The execution will be sorted by directory name. diff --git a/system_setup/config.dist/setup_system.conf.dist b/system_setup/config.dist/setup_system.conf.dist index bede8c8..5c09a38 100644 --- a/system_setup/config.dist/setup_system.conf.dist +++ b/system_setup/config.dist/setup_system.conf.dist @@ -31,8 +31,13 @@ fi export FQDN=${HOSTNM}.${DOMAIN} #Additional Client-Software- Repository-Folder in Nextcloud (Shared Folder / Systemwide) -export CLIENT_SOFTWARE_DST="/opt/sys_config/client_software" # Optional. If you don't have a Folder that should always be synced, leave this empty -export CLIENT_SOFTWARE_SRC="/Shared/sw_geteilt/client_software" Set to the Nextcloud directory where the software should come from +export CLIENT_SOFTWARE_CUST_DST="${SYSCONFIGPATH}/client_software_cust" # Required. Must not be changed! +export CLIENT_SOFTWARE_CUST_SRC="/Shared/sw_geteilt/client_software_cust" # Set to the Nextcloud directory where the software should come from + +# OBSOLETE / OLD Variables for packaged files under client_software. Those files will not be synced to NC any more! +# if still set, they will cause sync to complain about it +unset CLIENT_SOFTWARE_DST +unset CLIENT_SOFTWARE_SRC #Secure File Encryption #Needs a running KRA- Service on FreeIPA diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index f1ade3a..d7032ab 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -79,6 +79,17 @@ elog_add "Update and install client software" #Set global to enable git git config --global --add safe.directory /opt/sys_config +# Pre check for old configuration parameters, will be removed in the future +if [ ! -z "${CLIENT_SOFTWARE_DST}" ] || [ ! -z "${CLIENT_SOFTWARE_SRC}" ]; then + elog_add " ====================" + elog_add "WARNING: Your company/setup has still CLIENT_SOFTWARE_DST or CLIENT_SOFTWARE_SRC set." + elog_add "These parameters are obsolete and must be removed! The new parameters are CLIENT_SOFTWARE_CUST_DST and CLIENT_SOFTWARE_CUST_SRC" + elog_add "as the software repository has been split into customer software and distributed software." + elog_add "Please try to relog first. If this problem reoccures, contact your system admins to correct it." + elog_add "Will continue with the new path. Press any key to continue." + read -n 1 -s -r +fi + # First, check the sudo rule elog_add "Check the matching client rule:" #Somewhat strange "sudo -l" will *sometimes* ask for password instead of just checking if the rule can be found, so it needs -n to be silent @@ -117,8 +128,6 @@ else elog_add "" elog_add "Running client software sync..." elog_add_command "/usr/bin/sudo -n --preserve-env ${SYSCONFIGPATH}/system_setup/sync_client_software.sh install $1" - #ERRTXT=$( { /usr/bin/sudo -n --preserve-env ${SYSCONFIGPATH}/system_setup/sync_client_software.sh install > >(tee -a ${LOGFILE}); } 2>&1 ) - #ERR=$? if [[ $RETNO -ne 0 ]]; then elog_add "Errorcode was $RETNO" elog_add "Error executing software sync and install, please check your output!" @@ -131,7 +140,8 @@ fi #elog_add_command "${CLIENT_SOFTWARE_DST}/user_run.sh $1" elog_add "Running all software scripts in user- context." #1. Run the scripts, that are delivered by the package maintainers -for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" +elog_add "Pre Installed scripts" +for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); # list directories in the form "/tmp/dirname/" do DIR=${DIR%*/} # remove the trailing "/" if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then @@ -148,12 +158,37 @@ do elog_add "Some Error in script, will not continue. Please check." elog_add "Press any key to continue." read -n 1 -s -r - cd ${SCRIPTPATH} exit 1 fi elog_add " ====================" fi done +#2. Run the scripts, that are delivered by the package maintainers +if [ -d "${CLIENT_SOFTWARE_CUST_DST}" ]; then + elog_add "Company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" + for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" + do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + elog_add "Skipping ${DIR} while not in search parameter ( $1 )." + continue + fi + if [ -f "${DIR}/user_run.sh" ]; then + elog_add " >>> Running ${DIR}/user_run.sh" + cd ${DIR} + elog_add_command "${DIR}/user_run.sh" + if [ $? -ne 0 ]; then + elog_add " ====================" + elog_add "Some Error in script, will not continue. Please check." + elog_add "Press any key to continue." + read -n 1 -s -r + exit 1 + fi + elog_add " ====================" + fi + done +fi elog_add "Completed user scripts in software." elog_add "" diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index bf19ba3..5bb4327 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -130,16 +130,51 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi fi -#Check if Repository is defined -if [ "${CLIENT_SOFTWARE_DST}." == "." ]; then - echo "No central softwarerepository defined (CLIENT_SOFTWARE_DST). Skipping sync." +echo "Running all software scripts in admin- context." +# Run pre installed scripts in client_software +echo "Running pre installed scripts first." +for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + echo "Skipping ${DIR} while not in search parameter ( $1 )." + continue + fi + if [ -f "${DIR}/install.sh" ]; then + echo " ====================" + echo " >>> Running ${DIR}/install.sh" + cd ${DIR} + ${DIR}/install.sh + if [ $? -ne 0 ]; then + echo " ====================" + echo "Some Error in script, will not continue. Please check." + echo "Press any key to continue." + read -n 1 -s -r + exit 1 + fi + echo " ====================" + fi +done +echo "Sucessfully installed pre-defined software." +echo + +# Repository must be the right path (but maybe empty, which is fine) +if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then + echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." + echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." + read -n 1 -s -r -p "Press any key to continue" + echo "" + exit 1 else # Then, sync all client_software-files - if [[ ! -z "${CLIENT_SOFTWARE_SRC}" ]]; then - echo "Syncing central softwarerepository ${CLIENT_SOFTWARE_DST}" + if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then + echo "No customer software sync is defined, skipping sync" + echo "${CLIENT_SOFTWARE_CUST_DST} with ${CLIENT_SOFTWARE_CUST_SRC}" + else + echo "Syncing customer software repository ${CLIENT_SOFTWARE_CUST_DST}" # Create Directory if not existent - mkdir -p ${CLIENT_SOFTWARE_DST} - SYNCCMD="sudo -i /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloudcmd com.nextcloud.desktopclient.nextcloud -h -u ${DAVTOKEN_USER} -p ${DAVTOKEN_PASS} --path ${CLIENT_SOFTWARE_SRC} ${CLIENT_SOFTWARE_DST} https://${SERVERFQDN_NC}" + mkdir -p ${CLIENT_SOFTWARE_CUST_DST} + SYNCCMD="sudo -i /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloudcmd com.nextcloud.desktopclient.nextcloud -h -u ${DAVTOKEN_USER} -p ${DAVTOKEN_PASS} --path ${CLIENT_SOFTWARE_CUST_SRC} ${CLIENT_SOFTWARE_CUST_DST} https://${SERVERFQDN_NC}" SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" ) echo "Exec: ${SYNCCMD_HIDDENPW}" echo "Sync Client Software" @@ -155,19 +190,20 @@ else exit 1 fi echo "Sucessfully synced." + + # After sync again, restore the rights to all filles. They must be owned by root, changeable by admingroup and readable by otherusers (we are root, so we can change!) + chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} + chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} fi - echo "" +fi +echo - # After sync again, restore the rights to all filles. They must be owned by root, changeable by admingroup and readable by otherusers (we are root, so we can change!) - chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} - chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} - #Make all install.sh executable - find ${CLIENT_SOFTWARE_DST} -type f -name install.sh -exec chmod ugo+x {} \; - - #Run Software setup +#Run customer setup +if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then echo "Running all software scripts in admin- context." - for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" - do + #Make all install.sh executable + find ${CLIENT_SOFTWARE_CUST_DST} -type f -name install.sh -exec chmod ugo+x {} \; + for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then #search for string in dir @@ -189,12 +225,12 @@ else echo " ====================" fi done - - #Last, remove unused Flatpak- Runtimes and unused Data - echo "Removing unused Flatpak- Data." - flatpak uninstall --unused -y - - echo "Sucessfully installed software." fi + +#Last, remove unused Flatpak- Runtimes and unused Data +echo "Removing unused Flatpak- Data." +flatpak uninstall --unused -y + +echo "Sucessfully installed software." echo "" exit 0 From aaa7b73d5318f6cbea2f2d04d59cf864fdaa366e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:40:08 +0200 Subject: [PATCH 06/14] sync_client_software: fix permissions and parameter check --- system_setup/sync_client_software.sh | 46 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 5bb4327..84c5fdc 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -73,6 +73,27 @@ else fi echo "" +# Repository must always be set to the right path (but maybe empty, which is fine) +if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then + echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." + echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." + read -n 1 -s -r -p "Press any key to continue" + echo "" + exit 1 +fi + +# Before running sync or software installs, restore the rights to all filles. +# They must be owned by root, changeable by admingroup and readable by otherusers (we are root, so we can change!) +# user_run.sh must also be executable by users +chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} +chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} + +#Make all install.sh executable +find ${SYSCONFIGPATH}/client_software} -type f -name install.sh -exec chmod ug+x,o-x {} \; +find ${SYSCONFIGPATH}/client_software} -type f -name user_run.sh -exec chmod ugo+x {} \; +find ${CLIENT_SOFTWARE_CUST_DST} -type f -name install.sh -exec chmod ug+x,o-x {} \; +find ${CLIENT_SOFTWARE_CUST_DST} -type f -name user_run.sh -exec chmod ugo+x {} \; + # At first, sync central configs if they are configured to be synced if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then echo "Synced config path was found, doing remote sync." @@ -135,9 +156,9 @@ echo "Running all software scripts in admin- context." echo "Running pre installed scripts first." for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" - if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + if [[ "$2." != "." ]] && [[ "${DIR}" != *"$2"* ]]; then #search for string in dir - echo "Skipping ${DIR} while not in search parameter ( $1 )." + echo "Skipping ${DIR} while not in search parameter ( $2 )." continue fi if [ -f "${DIR}/install.sh" ]; then @@ -158,19 +179,11 @@ done echo "Sucessfully installed pre-defined software." echo -# Repository must be the right path (but maybe empty, which is fine) -if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then - echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." - echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." - read -n 1 -s -r -p "Press any key to continue" - echo "" - exit 1 -else - # Then, sync all client_software-files - if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then +# Then, sync all client_software-files +if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then echo "No customer software sync is defined, skipping sync" echo "${CLIENT_SOFTWARE_CUST_DST} with ${CLIENT_SOFTWARE_CUST_SRC}" - else +else echo "Syncing customer software repository ${CLIENT_SOFTWARE_CUST_DST}" # Create Directory if not existent mkdir -p ${CLIENT_SOFTWARE_CUST_DST} @@ -190,19 +203,12 @@ else exit 1 fi echo "Sucessfully synced." - - # After sync again, restore the rights to all filles. They must be owned by root, changeable by admingroup and readable by otherusers (we are root, so we can change!) - chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} - chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} - fi fi echo #Run customer setup if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then echo "Running all software scripts in admin- context." - #Make all install.sh executable - find ${CLIENT_SOFTWARE_CUST_DST} -type f -name install.sh -exec chmod ugo+x {} \; for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then From 8dc8cca48c56ce9c831f1f8ff13f2cead99d41b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:48:57 +0200 Subject: [PATCH 07/14] sync_client_software: fix location of checks --- system_setup/sync_client_software.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 84c5fdc..4fbdab1 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -73,15 +73,6 @@ else fi echo "" -# Repository must always be set to the right path (but maybe empty, which is fine) -if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then - echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." - echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." - read -n 1 -s -r -p "Press any key to continue" - echo "" - exit 1 -fi - # Before running sync or software installs, restore the rights to all filles. # They must be owned by root, changeable by admingroup and readable by otherusers (we are root, so we can change!) # user_run.sh must also be executable by users @@ -91,8 +82,8 @@ chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} #Make all install.sh executable find ${SYSCONFIGPATH}/client_software} -type f -name install.sh -exec chmod ug+x,o-x {} \; find ${SYSCONFIGPATH}/client_software} -type f -name user_run.sh -exec chmod ugo+x {} \; -find ${CLIENT_SOFTWARE_CUST_DST} -type f -name install.sh -exec chmod ug+x,o-x {} \; -find ${CLIENT_SOFTWARE_CUST_DST} -type f -name user_run.sh -exec chmod ugo+x {} \; +find ${SYSCONFIGPATH}/client_software_cust -type f -name install.sh -exec chmod ug+x,o-x {} \; +find ${SYSCONFIGPATH}/client_software_cust -type f -name user_run.sh -exec chmod ugo+x {} \; # At first, sync central configs if they are configured to be synced if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then @@ -151,6 +142,15 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi fi +# To run scripts, the tepository path must always be set right (but maybe empty, which is fine) +if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then + echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." + echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." + read -n 1 -s -r -p "Press any key to continue" + echo "" + exit 1 +fi + echo "Running all software scripts in admin- context." # Run pre installed scripts in client_software echo "Running pre installed scripts first." From 198f17157d86ce3bbbd38c4a0fff44babc928e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:51:38 +0200 Subject: [PATCH 08/14] sync_client_software: type in paths --- system_setup/sync_client_software.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 4fbdab1..54c4b63 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -80,8 +80,8 @@ chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} #Make all install.sh executable -find ${SYSCONFIGPATH}/client_software} -type f -name install.sh -exec chmod ug+x,o-x {} \; -find ${SYSCONFIGPATH}/client_software} -type f -name user_run.sh -exec chmod ugo+x {} \; +find ${SYSCONFIGPATH}/client_software -type f -name install.sh -exec chmod ug+x,o-x {} \; +find ${SYSCONFIGPATH}/client_software -type f -name user_run.sh -exec chmod ugo+x {} \; find ${SYSCONFIGPATH}/client_software_cust -type f -name install.sh -exec chmod ug+x,o-x {} \; find ${SYSCONFIGPATH}/client_software_cust -type f -name user_run.sh -exec chmod ugo+x {} \; From 01e5a3ba8578893f9575689b2345e18acfd18e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 12:59:59 +0200 Subject: [PATCH 09/14] logon_script: Add Check for right config values sync_client_software move check to better place --- system_setup/logon_script.sh | 10 ++++-- system_setup/sync_client_software.sh | 54 ++++++++++++++-------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index d7032ab..40737b9 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -137,7 +137,6 @@ else fi #Anyway run user scripts if existent -#elog_add_command "${CLIENT_SOFTWARE_DST}/user_run.sh $1" elog_add "Running all software scripts in user- context." #1. Run the scripts, that are delivered by the package maintainers elog_add "Pre Installed scripts" @@ -164,7 +163,14 @@ do fi done #2. Run the scripts, that are delivered by the package maintainers -if [ -d "${CLIENT_SOFTWARE_CUST_DST}" ]; then +# To run scripts, the tepository path must always be set right (but maybe empty, which is fine) +if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then + echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." + echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." + read -n 1 -s -r -p "Press any key to continue" + echo + exit 1 +else elog_add "Company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" do diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 54c4b63..e2d887b 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -142,15 +142,6 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi fi -# To run scripts, the tepository path must always be set right (but maybe empty, which is fine) -if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then - echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." - echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." - read -n 1 -s -r -p "Press any key to continue" - echo "" - exit 1 -fi - echo "Running all software scripts in admin- context." # Run pre installed scripts in client_software echo "Running pre installed scripts first." @@ -179,11 +170,19 @@ done echo "Sucessfully installed pre-defined software." echo -# Then, sync all client_software-files -if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then +# To run scripts, the repository path must always be set right (but maybe empty, which is fine) +if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then + echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." + echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." + read -n 1 -s -r -p "Press any key to continue" + echo + exit 1 +else + # Then, sync all client_software-files + if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then echo "No customer software sync is defined, skipping sync" echo "${CLIENT_SOFTWARE_CUST_DST} with ${CLIENT_SOFTWARE_CUST_SRC}" -else + else echo "Syncing customer software repository ${CLIENT_SOFTWARE_CUST_DST}" # Create Directory if not existent mkdir -p ${CLIENT_SOFTWARE_CUST_DST} @@ -203,20 +202,20 @@ else exit 1 fi echo "Sucessfully synced." -fi -echo + fi + echo -#Run customer setup -if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then - echo "Running all software scripts in admin- context." - for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do - DIR=${DIR%*/} # remove the trailing "/" - if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then - #search for string in dir - echo "Skipping ${DIR} while not in search parameter ( $1 )." - continue - fi - if [ -f "${DIR}/install.sh" ]; then + #Run customer setup + if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then + echo "Running all software scripts in admin- context." + for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + echo "Skipping ${DIR} while not in search parameter ( $1 )." + continue + fi + if [ -f "${DIR}/install.sh" ]; then echo " ====================" echo " >>> Running ${DIR}/install.sh" cd ${DIR} @@ -229,8 +228,9 @@ if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then exit 1 fi echo " ====================" - fi - done + fi + done + fi fi #Last, remove unused Flatpak- Runtimes and unused Data From 08a0a6d2f0744e9d0bea847d80eac8b916e6560b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 13:04:40 +0200 Subject: [PATCH 10/14] logon_script: skip parts when parameters are wrong --- system_setup/logon_script.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index 40737b9..823f061 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -168,8 +168,6 @@ if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; echo "Error in config: Required parameter CLIENT_SOFTWARE_CUST_DST is missing or set wrong." echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." read -n 1 -s -r -p "Press any key to continue" - echo - exit 1 else elog_add "Company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" @@ -194,8 +192,8 @@ else elog_add " ====================" fi done + elog_add "Completed user scripts in software." fi -elog_add "Completed user scripts in software." elog_add "" # Remove unused flatpak user installed software and data From 536bf095d48a731294690c2b67481c8a6083d073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 13:20:37 +0200 Subject: [PATCH 11/14] Cosmetic changes --- system_setup/logon_script.sh | 16 +++++++++++----- system_setup/sync_client_software.sh | 10 ++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index 823f061..b7bbc09 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -82,11 +82,14 @@ git config --global --add safe.directory /opt/sys_config # Pre check for old configuration parameters, will be removed in the future if [ ! -z "${CLIENT_SOFTWARE_DST}" ] || [ ! -z "${CLIENT_SOFTWARE_SRC}" ]; then elog_add " ====================" + elog_add "" elog_add "WARNING: Your company/setup has still CLIENT_SOFTWARE_DST or CLIENT_SOFTWARE_SRC set." elog_add "These parameters are obsolete and must be removed! The new parameters are CLIENT_SOFTWARE_CUST_DST and CLIENT_SOFTWARE_CUST_SRC" elog_add "as the software repository has been split into customer software and distributed software." elog_add "Please try to relog first. If this problem reoccures, contact your system admins to correct it." elog_add "Will continue with the new path. Press any key to continue." + elog_add "" + elog_add " ====================" read -n 1 -s -r fi @@ -126,7 +129,7 @@ else # Rule seems to be ok, executing script elog_add "Matching Sudo rule found." elog_add "" - elog_add "Running client software sync..." + elog_add "Running ${SYSCONFIGPATH}/system_setup/sync_client_software.sh" elog_add_command "/usr/bin/sudo -n --preserve-env ${SYSCONFIGPATH}/system_setup/sync_client_software.sh install $1" if [[ $RETNO -ne 0 ]]; then elog_add "Errorcode was $RETNO" @@ -137,9 +140,9 @@ else fi #Anyway run user scripts if existent -elog_add "Running all software scripts in user- context." +elog_add "Running scripts in user- context." #1. Run the scripts, that are delivered by the package maintainers -elog_add "Pre Installed scripts" +elog_add "Pre installed scripts" for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); # list directories in the form "/tmp/dirname/" do DIR=${DIR%*/} # remove the trailing "/" @@ -162,6 +165,8 @@ do elog_add " ====================" fi done +elog_add "Done running pre installed scripts" + #2. Run the scripts, that are delivered by the package maintainers # To run scripts, the tepository path must always be set right (but maybe empty, which is fine) if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; then @@ -169,7 +174,7 @@ if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." read -n 1 -s -r -p "Press any key to continue" else - elog_add "Company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" + elog_add "Running company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" do DIR=${DIR%*/} # remove the trailing "/" @@ -192,8 +197,9 @@ else elog_add " ====================" fi done - elog_add "Completed user scripts in software." + elog_add "Done running company scripts" fi +elog_add "Completed user scripts." elog_add "" # Remove unused flatpak user installed software and data diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index e2d887b..07701fd 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -142,9 +142,9 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi fi -echo "Running all software scripts in admin- context." +echo "Running scripts in admin- context." # Run pre installed scripts in client_software -echo "Running pre installed scripts first." +echo "Running pre installed scripts in admin- context." for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$2." != "." ]] && [[ "${DIR}" != *"$2"* ]]; then @@ -167,7 +167,7 @@ for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do echo " ====================" fi done -echo "Sucessfully installed pre-defined software." +echo "Done running pre installed scripts in admin- context." echo # To run scripts, the repository path must always be set right (but maybe empty, which is fine) @@ -182,6 +182,7 @@ else if [[ -z "${CLIENT_SOFTWARE_CUST_SRC}" ]]; then echo "No customer software sync is defined, skipping sync" echo "${CLIENT_SOFTWARE_CUST_DST} with ${CLIENT_SOFTWARE_CUST_SRC}" + echo else echo "Syncing customer software repository ${CLIENT_SOFTWARE_CUST_DST}" # Create Directory if not existent @@ -207,7 +208,7 @@ else #Run customer setup if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then - echo "Running all software scripts in admin- context." + echo "Running all company scripts in user- context." for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then @@ -230,6 +231,7 @@ else echo " ====================" fi done + echo "Done running all company scripts in user- context." fi fi From a250476b44b85bab17c970c7470c22b2fac2d93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 13:28:14 +0200 Subject: [PATCH 12/14] even more cosmetics --- system_setup/logon_script.sh | 12 ++++++------ system_setup/sync_client_software.sh | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/system_setup/logon_script.sh b/system_setup/logon_script.sh index b7bbc09..f6f3f22 100755 --- a/system_setup/logon_script.sh +++ b/system_setup/logon_script.sh @@ -140,9 +140,9 @@ else fi #Anyway run user scripts if existent -elog_add "Running scripts in user- context." +elog_add "Running user setup scripts in user- context." #1. Run the scripts, that are delivered by the package maintainers -elog_add "Pre installed scripts" +elog_add "Pre installed user setup scripts" for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); # list directories in the form "/tmp/dirname/" do DIR=${DIR%*/} # remove the trailing "/" @@ -165,7 +165,7 @@ do elog_add " ====================" fi done -elog_add "Done running pre installed scripts" +elog_add "Done running pre installed user setup scripts" #2. Run the scripts, that are delivered by the package maintainers # To run scripts, the tepository path must always be set right (but maybe empty, which is fine) @@ -174,7 +174,7 @@ if [ "${CLIENT_SOFTWARE_CUST_DST}" != "${SYSCONFIGPATH}/client_software_cust" ]; echo "Please relog and if the problem reoccures, contact your system admins to correct the Values." read -n 1 -s -r -p "Press any key to continue" else - elog_add "Running company delivered scripts in ${CLIENT_SOFTWARE_CUST_DST}" + elog_add "Running company delivered user setup scripts in ${CLIENT_SOFTWARE_CUST_DST}" for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" do DIR=${DIR%*/} # remove the trailing "/" @@ -197,9 +197,9 @@ else elog_add " ====================" fi done - elog_add "Done running company scripts" + elog_add "Done running company user setup scripts" fi -elog_add "Completed user scripts." +elog_add "Completed user setup scripts." elog_add "" # Remove unused flatpak user installed software and data diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 07701fd..296a9de 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -142,9 +142,9 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then fi fi -echo "Running scripts in admin- context." +echo "Running install scripts in admin- context." # Run pre installed scripts in client_software -echo "Running pre installed scripts in admin- context." +echo "Running pre installed install scripts in admin- context." for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$2." != "." ]] && [[ "${DIR}" != *"$2"* ]]; then @@ -167,7 +167,7 @@ for DIR in $(ls -d ${SYSCONFIGPATH}/client_software/*/ | sort); do echo " ====================" fi done -echo "Done running pre installed scripts in admin- context." +echo "Done running pre installed install scripts in admin- context." echo # To run scripts, the repository path must always be set right (but maybe empty, which is fine) @@ -208,7 +208,7 @@ else #Run customer setup if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then - echo "Running all company scripts in user- context." + echo "Running company install scripts in user- context." for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then @@ -231,7 +231,7 @@ else echo " ====================" fi done - echo "Done running all company scripts in user- context." + echo "Done running company install scripts in user- context." fi fi From 793bbc045a037fdf193169d1e885a569a6b7dfb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 13:36:41 +0200 Subject: [PATCH 13/14] sync_client_software: Fixed parameter to skip software --- system_setup/sync_client_software.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index 296a9de..ccc051a 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -211,9 +211,9 @@ else echo "Running company install scripts in user- context." for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" - if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + if [[ "$2." != "." ]] && [[ "${DIR}" != *"$2"* ]]; then #search for string in dir - echo "Skipping ${DIR} while not in search parameter ( $1 )." + echo "Skipping ${DIR} while not in search parameter ( $2 )." continue fi if [ -f "${DIR}/install.sh" ]; then From 6293ba22f6e36af72414da56c08ff2fdc8640593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Fri, 8 May 2026 16:53:31 +0200 Subject: [PATCH 14/14] Fix permissions after sync of cust repo --- system_setup/sync_client_software.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index ccc051a..b1c4430 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -82,8 +82,6 @@ chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} #Make all install.sh executable find ${SYSCONFIGPATH}/client_software -type f -name install.sh -exec chmod ug+x,o-x {} \; find ${SYSCONFIGPATH}/client_software -type f -name user_run.sh -exec chmod ugo+x {} \; -find ${SYSCONFIGPATH}/client_software_cust -type f -name install.sh -exec chmod ug+x,o-x {} \; -find ${SYSCONFIGPATH}/client_software_cust -type f -name user_run.sh -exec chmod ugo+x {} \; # At first, sync central configs if they are configured to be synced if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then @@ -206,9 +204,21 @@ else fi echo + # After Snc NC is not able to set permission the right way (like execution flag) + # So this need to be done again for new files coming in via sync + # we do it either with or without sync for better safety + chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH} + chmod ug+rwX,o=rX -R ${SYSCONFIGPATH} + + #Make all install.sh executable + find ${SYSCONFIGPATH}/client_software -type f -name install.sh -exec chmod ug+x,o-x {} \; + find ${SYSCONFIGPATH}/client_software -type f -name user_run.sh -exec chmod ugo+x {} \; + find ${SYSCONFIGPATH}/client_software_cust -type f -name install.sh -exec chmod ug+x,o-x {} \; + find ${SYSCONFIGPATH}/client_software_cust -type f -name user_run.sh -exec chmod ugo+x {} \; + #Run customer setup if [ ! -z "${CLIENT_SOFTWARE_CUST_DST}" ]; then - echo "Running company install scripts in user- context." + echo "Running company install scripts in admin- context." for DIR in $(ls -d ${CLIENT_SOFTWARE_CUST_DST}/*/ | sort); do DIR=${DIR%*/} # remove the trailing "/" if [[ "$2." != "." ]] && [[ "${DIR}" != *"$2"* ]]; then @@ -231,7 +241,7 @@ else echo " ====================" fi done - echo "Done running company install scripts in user- context." + echo "Done running company install scripts in admin- context." fi fi @@ -239,6 +249,6 @@ fi echo "Removing unused Flatpak- Data." flatpak uninstall --unused -y -echo "Sucessfully installed software." +echo "Done running install scripts in admin- context." echo "" exit 0