summaryrefslogtreecommitdiffstatshomepage
path: root/docker-machine
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-07-11 16:00:49 -0500
committerToby Vincent <tobyv13@gmail.com>2021-07-11 16:00:49 -0500
commita6cc72f3d4693930c1485b4ee6a06b4345cba046 (patch)
treefb102c64e2ecce81ca8175f63070fd0072f34eac /docker-machine
parentae8a1bef061bff439d63c2e9ce48f49e31705e45 (diff)
feat: added docker machine
Diffstat (limited to 'docker-machine')
-rwxr-xr-xdocker-machine/install30
-rwxr-xr-xdocker-machine/uninstall5
2 files changed, 35 insertions, 0 deletions
diff --git a/docker-machine/install b/docker-machine/install
new file mode 100755
index 0000000..5bbd82c
--- /dev/null
+++ b/docker-machine/install
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+SCRIPT="docker-machine-installer"
+
+if docker compose >&/dev/null; then
+ current_version=0.0.0
+ echo "$SCRIPT: not installed"
+else
+ current_version=$(docker-machine --version >&/dev/null | grep -oE '[0-9]+.[0-9\.]+')
+ echo "$SCRIPT: found $current_version"
+fi
+
+# version=$(curl -s "https://api.github.com/repos/docker/machine/releases" | grep -oE '[0-9]+.[0-9\.]+')
+version="0.16.2"
+
+if [[ "$version" == "$current_version" ]]; then
+ echo "$SCRIPT: up-to-date"
+else
+ echo "$SCRIPT: new version found $version"
+ echo "$SCRIPT: downloading..."
+
+ arch="$(uname -s)-$(uname -m)"
+ echo "https://github.com/docker/machine/releases/download/v$version/docker-machine-$arch"
+
+ curl -L "https://github.com/docker/machine/releases/download/v$version/docker-machine-$arch" >/tmp/docker-machine &&
+ chmod +x /tmp/docker-machine &&
+ cp /tmp/docker-machine "${HOME}/.local/bin"
+
+ echo "$SCRIPT: installed"
+fi
diff --git a/docker-machine/uninstall b/docker-machine/uninstall
new file mode 100755
index 0000000..5375ce8
--- /dev/null
+++ b/docker-machine/uninstall
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+if rm -f /usr/local/bin/docker-machine; then
+ echo "compose-cli: uninstalled"
+fi