[debian-edu-commits] debian-edu/pkg-team/ 04/08: debian/gosa.postinst: Avoid usage of full paths when testing for presence of executables.

Mike Gabriel sunweaver at debian.org
Mon Jan 4 23:05:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository gosa.

commit 204b2a316f115d3b13f2fc7bcde128ca5116e018
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Jan 4 23:30:51 2016 +0100

    debian/gosa.postinst: Avoid usage of full paths when testing for presence of executables.
---
 debian/gosa.postinst | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/debian/gosa.postinst b/debian/gosa.postinst
index e3a5741..495183e 100755
--- a/debian/gosa.postinst
+++ b/debian/gosa.postinst
@@ -60,8 +60,8 @@ if [ -d /etc/apache2/conf-available ] ; then
 		apache2_invoke enmod headers
 	fi
 	# Finally restart servers
-	if [ -x /usr/sbin/apache2 ]; then
-		if [ -x /usr/sbin/invoke-rc.d ]; then
+	if [ -x $(which apache2) ]; then
+		if [ -x $(which invoke-rc.d) ]; then
 			invoke-rc.d apache2 reload
 		else
 			/etc/init.d/apache2 reload
@@ -88,13 +88,13 @@ elif [ -d /etc/apache2/conf.d ]; then
 	fi
 
 	# Add support for RequestHeader
-	if [ -x /usr/sbin/a2enmod ]; then
+	if [ -x $(which a2enmod) ]; then
 		a2enmod headers
 	fi
 
 	# Finally restart servers
-	if [ -x /usr/sbin/apache2ctl ]; then
-		if [ -x /usr/sbin/invoke-rc.d ]; then
+	if [ -x $(which apache2ctl) ]; then
+		if [ -x $(which invoke-rc.d) ]; then
 			invoke-rc.d apache2 reload
 		else
 			/etc/init.d/apache2 reload
@@ -126,8 +126,8 @@ if [ -d /etc/lighttpd/conf-available ]; then
 	fi
 
 	# Finally restart servers
-	if [ -x /usr/sbin/lighttpd ]; then
-		if [ -x /usr/sbin/invoke-rc.d ]; then
+	if [ -x $(which lighttpd) ]; then
+		if [ -x $(which invoke-rc.d) ]; then
 			invoke-rc.d lighttpd reload
 		else
 			/etc/init.d/lighttpd reload
@@ -137,7 +137,7 @@ fi
 
 # Add links for safe mode
 [ ! -d /usr/share/gosa/bin ] && mkdir -p /usr/share/gosa/bin
-for source in /usr/bin/convert /usr/bin/lpstat; do
+for source in $(which convert) $(which lpstat); do
 	if [ -e $source ]; then
 		target=/usr/share/gosa/bin/${source##*/}
 		[ ! -L $target ] && ln -sf $source $target

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/gosa.git



More information about the debian-edu-commits mailing list