slackbuilds_ponce/network/ejabberd/doinst.sh
Alexander Verbovetsky b21a979ee3
network/ejabberd: Added (xmpp server)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-05-28 09:11:38 +07:00

25 lines
554 B
Bash

config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm $NEW
fi
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.ejabberd.new
config etc/ejabberd/ejabberd.yml.new
config etc/ejabberd/ejabberdctl.cfg.new
config etc/ejabberd/inetrc.new