slackbuilds_ponce/system/jenkins/doinst.sh
Giorgio Peron c1ddce54cb system/jenkins: Added (automated job monitor)
Thanks to Vincent Batts for some configs :-)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2011-08-11 20:28:36 -03:00

28 lines
631 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.jenkins.new
config etc/jenkins/jenkins.conf.new
config etc/logrotate.d/jenkins.new
config var/log/jenkins/jenkins.log.new
config var/log/jenkins/jenkins_console.log.new
rm -f var/log/jenkins/*.new