Obsoleted client_software/install.sh and user_run.sh
To make structure of client_software more clear for following introduction of client_software.2nd
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
#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
|
||||
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)."
|
||||
|
||||
Reference in New Issue
Block a user