From dc268f31987caaa1e95716c85414acd96ec9369b Mon Sep 17 00:00:00 2001 From: Samson-W Date: Fri, 24 Aug 2018 01:54:34 +0800 Subject: [PATCH] Add a method to check if the version of debian is 9. --- lib/utils.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/utils.sh b/lib/utils.sh index ab843fb..4a73582 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -382,3 +382,14 @@ is_pkg_installed() FNRET=1 fi } + +is_debian_9() +{ + if $(cat /etc/debian_version | grep -q "^9.[0-9]"); then + debug "Debian version is 9.*." + FNRET=0 + else + debug "Debian version is not 9.*." + FNRET=1 + fi +}