Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Fix warden.conf getting clobbered during package upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed Feb 14, 2014
1 parent 5ae7c8e commit 1aede14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
6 changes: 6 additions & 0 deletions src-sh/port-files/pkg-install
Expand Up @@ -37,4 +37,10 @@ if [ -e "${PREFIX}/share/pbi-manager/.pbime" ] ; then
install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.mount_nullfs /usr/pbi/.mount_nullfs install -o root -g wheel -m 755 ${PREFIX}/share/pbi-manager/.mount_nullfs /usr/pbi/.mount_nullfs
fi fi


# Check if we have our warden.conf file
if [ ! -e "/usr/local/etc/warden.conf" ] ; then
cp /usr/local/etc/warden.conf.dist /usr/local/etc/warden.conf
chmod 644 /usr/local/etc/warden.conf
fi

exit 0 exit 0
2 changes: 1 addition & 1 deletion src-sh/port-files/pkg-plist
Expand Up @@ -538,7 +538,7 @@ share/pcbsd/scripts/mkzfsdir.sh
share/pcbsd/scripts/reset-firewall share/pcbsd/scripts/reset-firewall
share/pcbsd/scripts/rmzfsdir.sh share/pcbsd/scripts/rmzfsdir.sh
share/pcbsd/scripts/sys-init.sh share/pcbsd/scripts/sys-init.sh
etc/warden.conf etc/warden.conf.dist
etc/pc-activedirectory.conf etc/pc-activedirectory.conf
etc/pc-ldap.conf etc/pc-ldap.conf
etc/rc.activedirectory etc/rc.activedirectory
Expand Down
21 changes: 2 additions & 19 deletions src-sh/warden/install.sh
Expand Up @@ -22,25 +22,8 @@ cd ${DIR}
cp bin/warden ${LB}/bin/warden cp bin/warden ${LB}/bin/warden
chmod 755 ${LB}/bin/warden chmod 755 ${LB}/bin/warden


# Save existing settings cp conf/warden.conf ${LB}/etc/warden.conf.dist
if [ -e "${LB}/etc/warden.conf" ] ; then chmod 644 ${LB}/etc/warden.conf.dist
NIC=`grep '^NIC:' ${LB}/etc/warden.conf | awk '{print $2}'`
WTMP=`grep '^WTMP:' ${LB}/etc/warden.conf | awk '{print $2}'`
JDIR=`grep '^JDIR:' ${LB}/etc/warden.conf | awk '{print $2}'`
ONIC=`grep '^NIC:' conf/warden.conf`
OWTMP=`grep '^WTMP:' conf/warden.conf`
OJDIR=`grep '^JDIR:' conf/warden.conf`
fi

cp conf/warden.conf ${LB}/etc/warden.conf
chmod 644 ${LB}/etc/warden.conf

# Save the settings
if [ -n "$NIC" ] ; then
sed -i '' "s|$ONIC|NIC: $NIC|g" ${LB}/etc/warden.conf
sed -i '' "s|$OWTMP|WTMP: $WTMP|g" ${LB}/etc/warden.conf
sed -i '' "s|$OJDIR|JDIR: $JDIR|g" ${LB}/etc/warden.conf
fi


if [ -d "${PROGDIR}/linux-installs" ] ; then if [ -d "${PROGDIR}/linux-installs" ] ; then
rm -rf ${PROGDIR}/linux-installs rm -rf ${PROGDIR}/linux-installs
Expand Down

0 comments on commit 1aede14

Please sign in to comment.