diff options
author | Pascal Mathis <mail@pascalmathis.com> | 2018-05-11 00:03:23 +0200 |
---|---|---|
committer | Pascal Mathis <mail@pascalmathis.com> | 2018-05-11 00:03:23 +0200 |
commit | 332266dbd1b5edd5bc0af3b5a4bd52b62a992fa3 (patch) | |
tree | 8e1472eb39db90d2a230da6d8c22902bc6a3feb6 /debianpkg | |
parent | Merge pull request #2195 from qlyoung/docuser (diff) | |
download | frr-332266dbd1b5edd5bc0af3b5a4bd52b62a992fa3.tar.xz frr-332266dbd1b5edd5bc0af3b5a4bd52b62a992fa3.zip |
debianpkg: improve VTYSH_PAGER environment check
The current post-installation scripts for all Debian packages execute
grep 'VTYSH_PAGER=/bin/cat' to check if the VTYSH_PAGER variable is
present within /etc/environment.
While presence of that environment variable should be checked, the
current implementation does not handle this line being a comment (and
therefor not active) or the user picking a different VTYSH_PAGER than
/bin/cat.
This commit ensures that the environment variable can be freely changed
by the user, while still guaranteeing that it is present in the file
without being a comment.
Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
Diffstat (limited to 'debianpkg')
-rw-r--r-- | debianpkg/backports/ubuntu14.04/debian/frr.postinst | 2 | ||||
-rw-r--r-- | debianpkg/frr.postinst | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/debianpkg/backports/ubuntu14.04/debian/frr.postinst b/debianpkg/backports/ubuntu14.04/debian/frr.postinst index b1d463a33..5a14e510c 100644 --- a/debianpkg/backports/ubuntu14.04/debian/frr.postinst +++ b/debianpkg/backports/ubuntu14.04/debian/frr.postinst @@ -18,7 +18,7 @@ chgrp ${frrvtygid} /etc/frr/vtysh* chmod 644 /etc/frr/* ENVIRONMENTFILE=/etc/environment -if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then +if ! egrep --quiet '^VTYSH_PAGER=' ${ENVIRONMENTFILE}; then echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE} fi ################################################## diff --git a/debianpkg/frr.postinst b/debianpkg/frr.postinst index 972f8c050..32af741c9 100644 --- a/debianpkg/frr.postinst +++ b/debianpkg/frr.postinst @@ -19,7 +19,7 @@ chgrp ${frrvtygid} /etc/frr/vtysh* chmod 644 /etc/frr/* ENVIRONMENTFILE=/etc/environment -if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then +if ! egrep --quiet '^VTYSH_PAGER=' ${ENVIRONMENTFILE}; then echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE} fi ################################################## |