Add shim installer 43/5943/1
authorMike Marchetti <mmarchetti@sandvine.com>
Thu, 5 Apr 2018 21:29:43 +0000 (17:29 -0400)
committerMike Marchetti <mmarchetti@sandvine.com>
Thu, 5 Apr 2018 21:30:30 +0000 (17:30 -0400)
Change-Id: Ic27326aaeed9fe35f251b3926158766c835072a9
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
installers/install_osm_release.sh [new file with mode: 0755]

diff --git a/installers/install_osm_release.sh b/installers/install_osm_release.sh
new file mode 100755 (executable)
index 0000000..dad6514
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+REPOSITORY_BASE=https://osm-download.etsi.org/repository/osm/debian
+RELEASE=ReleaseFOUR
+REPOSITORY=testing
+
+add_repo() {
+  REPO_CHECK="^$1"
+  grep "${REPO_CHECK/\[arch=amd64\]/\\[arch=amd64\\]}" /etc/apt/sources.list > /dev/null 2>&1
+  if [ $? -ne 0 ]
+  then
+    wget -qO - $REPOSITORY_BASE/$RELEASE/OSM%20ETSI%20Release%20Key.gpg | sudo apt-key add -
+    sudo DEBIAN_FRONTEND=noninteractive add-apt-repository -y "$1" && sudo DEBIAN_FRONTEND=noninteractive apt-get update
+    return 0
+  fi
+
+  return 1
+}
+
+add_repo "deb [arch=amd64] $REPOSITORY_BASE/$RELEASE $REPOSITORY devops"
+sudo DEBIAN_FRONTEND=noninteractive  apt-get install osm-devops
+/usr/share/osm-devops/installers/install_osm.sh -R $RELEASE -r $REPOSITORY -D /usr/share/osm-devops "$@"