Преглед изворни кода

Add an install portioner agent script

Robert Middleswarth пре 3 година
родитељ
комит
e971032fae
2 измењених фајлова са 20 додато и 0 уклоњено
  1. 20 0
      install_portainer_agent.sh
  2. 0 0
      update_libseccomp2.sh

+ 20 - 0
install_portainer_agent.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+function check_internet() {
+  printf "Checking if you are online..."
+  wget -q --spider http://github.com
+  if [ $? -eq 0 ]; then
+    echo "Online. Continuing."
+  else
+    error "Offline. Go connect to the internet then run the script again."
+  fi
+}
+
+check_internet
+
+sudo docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest || error "Failed to execute newer version of Portainer Agent!"

+ 0 - 0
update_libseccomp2.sh