Bladeren bron

Include Error checking features from Pull request #61 and include instructions to include the scrupt in the descript of the template.

Robert Middleswarth 3 jaren geleden
bovenliggende
commit
d1e8472e76
2 gewijzigde bestanden met toevoegingen van 15 en 8 verwijderingen
  1. 1 1
      pi-hosted_template/template/portainer-v2.json
  2. 14 7
      rpi_nginx-proxy-manager.sh

+ 1 - 1
pi-hosted_template/template/portainer-v2.json

@@ -1279,7 +1279,7 @@
 				"Proxy",
 				"Tools"
 			],
-			"description": "Nginx Proxy Manager enables you to easily forward to your websites running at home or otherwise, including free SSL, without having to know too much about Nginx or Letsencrypt.",
+			"description": "Nginx Proxy Manager enables you to easily forward to your websites running at home or otherwise, including free SSL, without having to know too much about Nginx or Letsencrypt.  Requires running the script rpi_nginx-proxy-manager.sh before installing the template",
 			"logo": "https://raw.githubusercontent.com/novaspirit/pi-hosted/master/pi-hosted_template/images/proxy_mgr.png",
 			"name": "nginx-proxy-manager",
 			"platform": "linux",

+ 14 - 7
rpi_nginx-proxy-manager.sh

@@ -1,8 +1,15 @@
-#!/bin/sh
-echo "creating directories"
-sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/data
-sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/letsencrypt
-sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/database
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+echo "Creating directories..."
+sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/data || error "Failed to create data folder!"
+sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/letsencrypt || error "Failed to create letsencrypt folder!"
+sudo mkdir -p /portainer/Files/AppData/Config/nginx-proxy-manager/database || error "Failed to create database folder!"
 echo "Creating a blank nginx-proxy-manager config files"
-sudo touch /portainer/Files/AppData/Config/nginx-proxy-manager/config.json
-echo "done you can now install the stack"
+sudo touch /portainer/Files/AppData/Config/nginx-proxy-manager/config.json || error "Failed to touch config.json file!"
+echo "Setup complete. You can now install the stack using the App Template."
+