From d1e8472e76da586866042aefdfd62fdc806b0875 Mon Sep 17 00:00:00 2001 From: Robert Middleswarth Date: Sat, 16 Oct 2021 23:26:19 -0400 Subject: [PATCH] Include Error checking features from Pull request #61 and include instructions to include the scrupt in the descript of the template. --- pi-hosted_template/template/portainer-v2.json | 2 +- rpi_nginx-proxy-manager.sh | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pi-hosted_template/template/portainer-v2.json b/pi-hosted_template/template/portainer-v2.json index 836e41b..029aa20 100644 --- a/pi-hosted_template/template/portainer-v2.json +++ b/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", diff --git a/rpi_nginx-proxy-manager.sh b/rpi_nginx-proxy-manager.sh index fc62837..6b86eee 100755 --- a/rpi_nginx-proxy-manager.sh +++ b/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." +