mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:24:02 -04:00
Add directory creation for host path in
generate-traccar-config and generate-traccar-config-for-casaos
This commit is contained in:
@@ -28,6 +28,12 @@ if [ -z "$host_path" ]; then
|
||||
host_path="/DATA/AppData/big-bear-traccar/traccar.xml"
|
||||
fi
|
||||
|
||||
# Extract the directory part from the provided path
|
||||
host_dir=$(dirname "$host_path")
|
||||
|
||||
# Create the directory if it does not exist
|
||||
mkdir -p "$host_dir"
|
||||
|
||||
# If the directory exists, ask the user if they want to remove it.
|
||||
# Otherwise, exit without removing the directory.
|
||||
if [ -d "$host_path" ]; then
|
||||
|
||||
@@ -28,6 +28,12 @@ if [ -z "$host_path" ]; then
|
||||
host_path="/DATA/AppData/traccar/traccar.xml"
|
||||
fi
|
||||
|
||||
# Extract the directory part from the provided path
|
||||
host_dir=$(dirname "$host_path")
|
||||
|
||||
# Create the directory if it does not exist
|
||||
mkdir -p "$host_dir"
|
||||
|
||||
# Check if the specified path is a directory.
|
||||
if [ -d "$host_path" ]; then
|
||||
echo "Error: $host_path is a directory."
|
||||
|
||||
Reference in New Issue
Block a user