Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 26 additions & 6 deletions scripts/install-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,29 @@ echo $from $to
apt install -y rsync
}

for plugin in $(find $from -type d -name phplist-plugin-*); do
[[ ! -z "$(ls -A $plugin/plugins/)" ]] && {
echo installing plugin $plugin
rsync -a $plugin/plugins/* $to
}
done
while IFS= read -r -d '' plugin; do
plugin_name="$(basename "$plugin")"

[[ -d "$plugin/plugins" ]] || continue
[[ -n "$(find "$plugin/plugins" -mindepth 1 -maxdepth 1 -print -quit)" ]] || continue

echo "Installing plugin: $plugin_name"

rsync_args=(-a)

case "$plugin_name" in
phplist-plugin-saml2)
settings_file="$to/simplesaml/settings.php"

if [[ -f "$settings_file" ]]; then
echo "Preserving existing SAML2 settings.php"
rsync_args+=(--exclude='simplesaml/settings.php')
else
echo "SAML2 settings.php does not exist, it will be created"
fi
;;
esac

rsync "${rsync_args[@]}" "$plugin/plugins/" "$to/"

done < <(find "$from" -type d -name 'phplist-plugin-*' -print0)
Loading