From f3ae970d37396baaaa946fc89250b29b43c9f1f0 Mon Sep 17 00:00:00 2001
From: "T. Joseph Carter" <tjcarter@spiritsubstance.com>
Date: Sat, 1 Sep 2018 15:37:44 -0700
Subject: [PATCH] Make creating /srv/A2SERVER more robust

---
 scripts/a2server-1-storage.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/a2server-1-storage.txt b/scripts/a2server-1-storage.txt
index 5441b32..9584e7a 100755
--- a/scripts/a2server-1-storage.txt
+++ b/scripts/a2server-1-storage.txt
@@ -18,8 +18,8 @@ fi
 
 if [[ ! -d /srv/A2SERVER ]]; then
 	echo "A2SERVER: Preparing the shared files volume..."
-	sudo mkdir -p /srv/A2SERVER
-	sudo chown $USER:$USER /srv/A2SERVER
+	mygroup="$(id -ng)"
+	sudo install -d -m 755 -u "$USER" -g "$mygroup" "/srv/A2SERVER"
 else
 	echo "A2SERVER: Shared volume is already prepared for use."
 fi