-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from mr-ssd/improve-config
update to 3.8.1 and improvement
- Loading branch information
Showing
11 changed files
with
251 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Install packages with retry logic | ||
set -e | ||
set -u | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update package index | ||
apt-get update -qq | ||
|
||
# Install packages with retry logic | ||
n=0 | ||
max=2 | ||
until [ $n -gt $max ]; do | ||
set +e | ||
( | ||
apt-get update -qq && | ||
apt-get install -y --no-install-recommends "$@" | ||
) | ||
CODE=$? | ||
set -e | ||
if [ $CODE -eq 0 ]; then | ||
break | ||
fi | ||
if [ $n -eq $max ]; then | ||
exit $CODE | ||
fi | ||
echo "apt failed, retrying" | ||
n=$(($n + 1)) | ||
set +e | ||
( | ||
apt-get install -y --no-install-recommends "$@" | ||
) | ||
CODE=$? | ||
set -e | ||
if [ $CODE -eq 0 ]; then | ||
break | ||
fi | ||
if [ $n -eq $max ]; then | ||
exit $CODE | ||
fi | ||
echo "apt failed, retrying in 10 seconds..." | ||
sleep 10 | ||
n=$(($n + 1)) | ||
done | ||
|
||
# Clean up after installation | ||
apt-get autoremove -y | ||
rm -r /var/lib/apt/lists /var/cache/apt/archives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#!/bin/bash | ||
|
||
function execute_scripts { | ||
if [ -e "${1}" ] && [[ $(find "${1}" -maxdepth 1 -name "*.sh" -printf "%f\n") ]] | ||
then | ||
echo "[PrivacyIDEA] Executing scripts in ${1}:" | ||
execute_scripts() { | ||
local script_dir="$1" | ||
local script_names | ||
|
||
for SCRIPT_NAME in $(find "${1}" -maxdepth 1 -name "*.sh" -printf "%f\n" | sort) | ||
do | ||
echo "" | ||
echo "[PrivacyIDEA] Executing ${SCRIPT_NAME}." | ||
if [[ -d "$script_dir" ]] && script_names=("$script_dir"/*.sh); (( ${#script_names[@]} )); then | ||
echo "[PrivacyIDEA] Executing scripts in $script_dir:" | ||
|
||
source "${1}/${SCRIPT_NAME}" | ||
done | ||
for script_path in "${script_names[@]}"; do | ||
local script_name=$(basename "$script_path") | ||
echo "" | ||
echo "[PrivacyIDEA] Executing $script_name." | ||
source "$script_path" || { echo "[PrivacyIDEA] Error: Failed to execute $script_name."; return 1; } | ||
done | ||
|
||
echo "" | ||
fi | ||
echo "" | ||
fi | ||
} |
Oops, something went wrong.