#!/bin/bash # Simple script to compare versions of packages # Capture parameters FUNC="$1" SRV_VERSION="$2" SRV_REQUIRED_VERSION="$3" RC=0 case $FUNC in "compareVersions") dpkg --compare-versions $SRV_VERSION lt $SRV_REQUIRED_VERSION || RC=1 if [ $RC -eq 0 ]; then echo "true" else echo "false" fi exit 0 ;; *) echo "[CompareVersions] Function Not supported" ;; esac exit 0