mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
fb858ac56e
* preserve old ejabberd as ejabberd-xs * have 5-xo-services use ejabberd-xs * install latest ejabberd on is_redhat * move ejabberd to 6-generic-apps * move the repo exclude * rename directory from - to _ * make disabled work
62 lines
1.4 KiB
Bash
Executable file
62 lines
1.4 KiB
Bash
Executable file
#!/bin/sh -e
|
|
|
|
#
|
|
# ejabberd now handles domain changes in the initrd script
|
|
#
|
|
SERVICE_NAME=ejabberd-xs
|
|
|
|
CONFIG_LIST="/etc/ejabberd/ejabberd-xs.cfg"
|
|
|
|
# taken from ejabberd spec %post
|
|
# taken from ejabberd spec %post
|
|
#function do-cert(){
|
|
# (cd /etc/ejabberd
|
|
# if [ ! -f ejabberd.pem ]
|
|
# then
|
|
# echo "Generating SSL certificate /etc/ejabberd/ejabberd.pem..."
|
|
# HOSTNAME=$(hostname -s)
|
|
# DOMAINNAME=$(hostname -d)
|
|
# openssl req -new -x509 -days 36500 -nodes -out ejabberd.pem -keyout ejabberd.pem > /dev/null 2>&1 << +++
|
|
# .
|
|
# .
|
|
# .
|
|
# $DOMAINNAME
|
|
# $HOSTNAME
|
|
# ejabberd
|
|
# root@$HOSTNAME.$DOMAINNAME
|
|
# +++
|
|
# chown ejabberd:ejabberd ejabberd.pem
|
|
# chmod 600 ejabberd.pem
|
|
# fi)
|
|
#}
|
|
|
|
# This is the suffix which original versions of modified files will have
|
|
BACKUP_SUFFIX=old
|
|
|
|
short_host=`hostname -s`
|
|
new_name=$short_host.$1
|
|
|
|
for config in $CONFIG_LIST;
|
|
do
|
|
if [ -e $config.in ]; then
|
|
if [ -e $config ]; then
|
|
mv $config $config.$BACKUP_SUFFIX
|
|
fi
|
|
sed -e s/{{ iiab_hostname }}/$new_name/ $config.in > $config ;
|
|
else
|
|
echo WARNING: Skipped $config - template file is missing!
|
|
fi
|
|
done
|
|
|
|
#if [ -e /etc/ejabberd/ejabberd.pem.$1 ]; then
|
|
# rm /etc/ejabberd/ejabberd.pem.$1
|
|
#fi
|
|
#mv /etc/ejabberd/ejabberd.pem /etc/ejabberd/ejabberd.pem.$1
|
|
#do-cert
|
|
|
|
# Since for the community edition, we don't really expect all modules to be present
|
|
# Just exit, and expect the user to do a restart
|
|
|
|
exit 0
|
|
|
|
|