summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-02 21:01:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-02 21:01:04 +0000
commitd6813af6148627621986f481186896e0d46d16c4 (patch)
tree86df42c30110e44a07738c2095b9315495b2424c
parentMaking postinst executable in source tree. (diff)
downloadnvme-cli-d6813af6148627621986f481186896e0d46d16c4.tar.xz
nvme-cli-d6813af6148627621986f481186896e0d46d16c4.zip
Rewriting postinst with the standard maintainer script.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rwxr-xr-xdebian/nvme-cli.postinst31
1 files changed, 23 insertions, 8 deletions
diff --git a/debian/nvme-cli.postinst b/debian/nvme-cli.postinst
index d2f0ca8..f984cc9 100755
--- a/debian/nvme-cli.postinst
+++ b/debian/nvme-cli.postinst
@@ -2,14 +2,29 @@
set -e
-if [ "$1" = "configure" ]; then
- if [ ! -s /etc/nvme/hostnqn ]; then
- nvme gen-hostnqn > /etc/nvme/hostnqn
- fi
+case "${1}" in
+ configure)
+ if [ ! -s /etc/nvme/hostnqn ]
+ then
+ nvme gen-hostnqn > /etc/nvme/hostnqn
+ fi
- if [ ! -s /etc/nvme/hostid ]; then
- uuidgen > /etc/nvme/hostid
- fi
-fi
+ if [ ! -s /etc/nvme/hostid ]
+ then
+ uuidgen > /etc/nvme/hostid
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
#DEBHELPER#
+
+exit 0