Title: [opsview] [12460] Add in a local shell profile file that will not be lost on an upgrade
Revision
12460
Author
dferguson
Date
2013-06-07 09:49:22 +0100 (Fri, 07 Jun 2013)

Log Message

Add in a local shell profile file that will not be lost on an upgrade

Customer wanted to add in additional environment variables used by plugins but these were lost on an upgrade.  Allow use of a local profile so changes will not be lost in the future

Modified Paths

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2013-06-06 16:43:52 UTC (rev 12459)
+++ trunk/CHANGES	2013-06-07 08:49:22 UTC (rev 12460)
@@ -4,6 +4,7 @@
     ENHANCEMENTS:
     Improved Debian postinstallation script so that only prompts for mysql root password on new installs
     Random passwords created for database connections for new installs
+    Add in a local shell profile file that will not be lost on an upgrade
     NOTICES:
     FIXES:
     Fixed CONTACTGROUPLIST environment macro, broken in Nagios 4 upgrade

Modified: trunk/opsview-core/bin/profile
===================================================================
--- trunk/opsview-core/bin/profile	2013-06-06 16:43:52 UTC (rev 12459)
+++ trunk/opsview-core/bin/profile	2013-06-07 08:49:22 UTC (rev 12460)
@@ -104,4 +104,9 @@
     unset PERL_VERS
 fi
 
+# check to see if there is a local profile and source that, also
+if [ -f $OPSVIEW_BASE/bin/profile_local ]; then
+    . $OPSVIEW_BASE/bin/profile_local
+fi
+
 # Must return ok

Modified: trunk/opsview-core/installer/set_profile
===================================================================
--- trunk/opsview-core/installer/set_profile	2013-06-06 16:43:52 UTC (rev 12459)
+++ trunk/opsview-core/installer/set_profile	2013-06-07 08:49:22 UTC (rev 12460)
@@ -46,6 +46,11 @@
 
 cd $HOME
 
+# create a local profile that will not be lost on an upgrade if it doesn't exist
+if [ ! -f /usr/local/nagios/bin/profile_local ]; then
+    echo "# Local profile - this file will not be changed in an upgrade" > /usr/local/nagios/bin/profile_local
+fi
+
 # make sure line is added to all files that exist, not just the first found
 # to fix problem with sudo on .deb based systems
 done=

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to