opnsense-ports/www/owncloud/pkg-install
Franco Fichtner ccb63ecacd */*: sync with upstream
Taken from: HardenedBSD
2018-11-24 10:07:45 +01:00

29 lines
886 B
Bash

#! /bin/sh
# ex:sw=4 sts=4
move_newsyslog_conf() {
oldfile=${PKG_PREFIX}/etc/newsyslog.conf.d/owncloud
newfile=${PKG_PREFIX}/etc/newsyslog.conf.d/owncloud.conf
samplefile=${PKG_PREFIX}/share/examples/owncloud/newsyslog
if [ -f ${oldfile} ]; then
echo "Configuration file found in old location: ${oldfile}"
if cmp -s ${samplefile} ${newfile} > /dev/null; then
echo "Configuration file in new location has not been modified from the default: ${newfile}"
echo " => Moving old configuration file to new location"
mv -f ${oldfile} ${newfile}
else
echo "Configuration file in new location has been modified from the default: ${newfile}"
echo " => Deleting old configuration file"
rm ${oldfile}
fi
fi
}
########################################################################
case $2 in
POST-INSTALL)
move_newsyslog_conf
;;
esac