From 361beab0b095797cc3cc5da16deecc28258d01a3 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Bhatti Date: Mon, 18 Apr 2016 16:45:44 +0500 Subject: [PATCH] UPDATE command made generic. Update command was hard-coded for debian or ubuntu based systems which was 'apt-get'. Setting an update variable accordingly solves this problem. --- util/install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/install.sh b/util/install.sh index 60eb7c1..c5ad595 100755 --- a/util/install.sh +++ b/util/install.sh @@ -40,6 +40,7 @@ if [ "$DIST" = "Ubuntu" ] || [ "$DIST" = "Debian" ]; then install='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q install' remove='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q remove' pkginst='sudo dpkg -i' + update='sudo apt-get' # Prereqs for this script if ! which lsb_release &> /dev/null; then $install lsb-release @@ -51,6 +52,7 @@ if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then install='sudo yum -y install' remove='sudo yum -y erase' pkginst='sudo rpm -ivh' + update='sudo yum' # Prereqs for this script if ! which lsb_release &> /dev/null; then $install redhat-lsb-core @@ -103,7 +105,7 @@ OF13_SWITCH_REV=${OF13_SWITCH_REV:-""} function kernel { echo "Install Mininet-compatible kernel if necessary" - sudo apt-get update + $update update if ! $install linux-image-$KERNEL_NAME; then echo "Could not install linux-image-$KERNEL_NAME" echo "Skipping - assuming installed kernel is OK."