summaryrefslogtreecommitdiff
path: root/debian/vyatta-cfg-system.postinst.in
diff options
context:
space:
mode:
authorMohit Mehta <mohit@vyatta.com>2011-04-20 14:18:22 -0700
committerMohit Mehta <mohit@vyatta.com>2011-04-20 14:18:22 -0700
commit77992d4359019ec8f6cb8ec2bde603679a806db5 (patch)
tree47cc31bf36e9f34af4e70f37318c4f06840617f5 /debian/vyatta-cfg-system.postinst.in
parent6b63b690f2d9659d7fc4813a4255a0d1617ba05a (diff)
downloadvyatta-cfg-quagga-77992d4359019ec8f6cb8ec2bde603679a806db5.tar.gz
vyatta-cfg-quagga-77992d4359019ec8f6cb8ec2bde603679a806db5.zip
Fix Bug 6811 ENH: add a proper post-configuration boot script
* added /config/scripts/vyatta-postconfig-bootup.script that gets called from /etc/rc.local. Users/Support can put in any workarounds in the script for unfixed bugs and enhancements that are not in Vyatta yet. Placing the script under /config makes sure that changes to the script will be preserved for the new image
Diffstat (limited to 'debian/vyatta-cfg-system.postinst.in')
-rw-r--r--debian/vyatta-cfg-system.postinst.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index a443b891..7daa9935 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -171,6 +171,36 @@ mkdir -p /opt/vyatta/etc/config/auth
mkdir -p /opt/vyatta/etc/config/scripts
mkdir -p /opt/vyatta/etc/config/user-data
+# create /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script
+# this should be after 'mkdir -p /opt/vyatta/etc/config/scripts' above
+if [ ! -x /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script ]; then
+ touch /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script
+ chmod 755 /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script
+ cat <<EOF >>/opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script
+#!/bin/sh
+# This script is called from /etc/rc.local on boot after the Vyatta
+# configuration is fully applied. Any modifications done to work around
+# unfixed bugs and implement enhancements which are not complete in the Vyatta
+# system can be placed here.
+EOF
+fi
+
+# call vyatta-postconfig-bootup.script from /etc/rc.local
+if ! grep -q /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script \
+ /etc/rc.local
+then
+ cat <<EOF >>/etc/rc.local
+# Do not remove the following call to vyatta-postconfig-bootup.script.
+# Any boot time workarounds should be put in script below so that they
+# get preserved for the new image during image upgrade.
+/opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script
+EOF
+ sh -c "sed -i -e '/exit 0/d' /etc/rc.local"
+ cat <<EOF >>/etc/rc.local
+exit 0
+EOF
+fi
+
touch /etc/environment
if [ ! -f /etc/bash_completion ]; then