From dc4cae7464efd7312ca29626efed55c3b26ecc62 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 31 Jul 2009 15:16:19 +0000 Subject: Use 'which' rather than 'type' in maintainer scripts. --- debian/changelog | 1 + debian/openssh-server.postinst | 2 +- debian/openssh-server.postrm | 2 +- debian/openssh-server.preinst | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 826ac9296..9cc5ddd31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ openssh (1:5.1p1-7) UNRELEASED; urgency=low * Set umask to 022 in the init script as well as postinsts (closes: #539030). * Add ${misc:Depends} to keep Lintian happy. + * Use 'which' rather than 'type' in maintainer scripts. -- Colin Watson Fri, 24 Jul 2009 18:43:45 +0100 diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst index b7ea210c4..e3558a8f5 100644 --- a/debian/openssh-server.postinst +++ b/debian/openssh-server.postinst @@ -163,7 +163,7 @@ create_key() { echo -n $msg ssh-keygen -q -f "$file" -N '' "$@" echo - if type restorecon >/dev/null 2>&1; then + if which restorecon >/dev/null 2>&1; then restorecon "$file.pub" fi fi diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm index 30682d6d0..7258d5f99 100644 --- a/debian/openssh-server.postrm +++ b/debian/openssh-server.postrm @@ -54,7 +54,7 @@ case $1 in update-rc.d ssh remove >/dev/null - if type deluser >/dev/null 2>&1; then + if which deluser >/dev/null 2>&1; then deluser --quiet sshd > /dev/null || true fi diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst index e6c150ba5..43c4b57f9 100644 --- a/debian/openssh-server.preinst +++ b/debian/openssh-server.preinst @@ -118,7 +118,7 @@ EOF # case the key is encrypted, which we need to fix chmod 600 $key ssh-keygen -u -f $key >/dev/null - if type restorecon >/dev/null 2>&1; then + if which restorecon >/dev/null 2>&1; then restorecon "$key.pub" fi } -- cgit v1.2.3