mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-26 22:06:35 +01:00
c1ddce54cb
Thanks to Vincent Batts for some configs :-) Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
28 lines
631 B
Bash
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
|
|
|