Skip to content

A self-hosted media server and file management system

fix: sudo commands are in .bat instead of .sh

aminnausinb274e9ed3da6
diff --git a/startDocker.bat b/startDocker.bat
index 262153b7..ca66ced1 100644
--- a/startDocker.bat
+++ b/startDocker.bat
@@ -112,8 +112,6 @@ if not exist "logs" (
mkdir "logs/mediaServer"
mkdir "logs/nginx"
mkdir "logs/caddy"
- sudo chown -R 9999:9999 ./logs/nginx
- chmod -R 755 logs
if errorlevel 1 (
call :ColorText "[ERROR]" Red
echo Failed to create 'logs' directory.
@@ -128,6 +126,28 @@ if not exist "logs" (
)
echo.
+:: Ensure caddy directory exists
+if not exist "caddy/data" (
+ call :ColorText "[INFO]" Blue
+ echo Missing 'caddy' directory. Creating it...
+ echo.
+ mkdir "caddy"
+ mkdir "caddy/data"
+ mkdir "caddy/config"
+ if errorlevel 1 (
+ call :ColorText "[ERROR]" Red
+ echo Failed to create 'caddy' directory.
+ pause
+ goto :end
+ )
+ call :ColorText "[SUCCESS]" Green
+ echo 'caddy' directory created.
+) else (
+ call :ColorText "[FOUND]" Green
+ echo 'caddy' directory.
+)
+echo.
+
call :ColorText "[STEP 2/5] " Yellow
echo Stopping and cleaning up Existing mediaServer Docker containers...
docker compose down
diff --git a/startDocker.sh b/startDocker.sh
index 0b13cff2..a6405fef 100644
--- a/startDocker.sh
+++ b/startDocker.sh
@@ -94,6 +94,8 @@ if [ ! -d "logs" ]; then
mkdir -p "logs/mediaServer"
mkdir -p "logs/nginx"
mkdir -p "logs/caddy"
+ sudo chown -R 9999:9999 ./logs/nginx
+ sudo chmod -R 755 logs
if [ $? -ne 0 ]; then
echo -e "${RED}[ERROR]${RESET} Failed to create 'logs' directory."
exit 1
@@ -104,6 +106,23 @@ else
fi
echo
+# Ensure caddy directory exists
+if [ ! -d "caddy/data" ]; then
+ echo -e "${BLUE}[INFO]${RESET} Missing 'caddy' directory. Creating it..."
+ echo
+ mkdir -p "caddy/data"
+ mkdir -p "caddy/config"
+ sudo chown -R 1000:1000 ./caddy
+ if [ $? -ne 0 ]; then
+ echo -e "${RED}[ERROR]${RESET} Failed to create 'caddy' directory."
+ exit 1
+ fi
+ echo -e "${GREEN}[SUCCESS]${RESET} 'caddy' directory created."
+else
+ echo -e "${GREEN}[FOUND]${RESET} 'caddy' directory."
+fi
+echo
+
echo -e "${YELLOW}[STEP 2/5]${RESET} Stopping and cleaning up Existing mediaServer Docker containers..."
docker compose down
if [ $? -ne 0 ]; then