mirror of
https://github.com/SaraSmiseth/prosody.git
synced 2025-05-04 05:00:39 +00:00
Refactor module install scripts to remove duplicate code. Fixes #6.
This commit is contained in:
parent
9e24592826
commit
476dbd06b8
3 changed files with 7 additions and 47 deletions
|
@ -40,7 +40,10 @@ for ext in $exts; do
|
|||
echo " - copying to ${target}"
|
||||
cp -r "${source}/mod_${ext}" "${target}/"
|
||||
|
||||
echo " - enabling within ${config}"
|
||||
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(modules_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
||||
echo "${new_config}" > "${config}"
|
||||
# Skip this if the modules should not be added to modules_enabled.
|
||||
if [ "$ext" != "http_upload" ] && [ "$ext" != "vcard_muc" ] ; then
|
||||
echo " - enabling within ${config}"
|
||||
new_config=$(cat "${config}" | module="${ext}" perl -0pe 's/(modules_enabled[ ]*=[ ]*{[^}]*)};/$1\n\t"$ENV{module}";\n};/')
|
||||
echo "${new_config}" > "${config}"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue