fix: create default folders [skip ci]

This commit is contained in:
Nicolas Meienberger 2022-10-09 17:41:37 +02:00
parent c67d92bdec
commit 98c86e0bcf
3 changed files with 14 additions and 1 deletions

View file

@ -55,6 +55,12 @@ function ensure_linux() {
function clean_logs() {
# Clean logs folder
logs_folder="${ROOT_FOLDER}/logs"
# Create the folder if it doesn't exist
if [[ ! -d "${logs_folder}" ]]; then
mkdir "${logs_folder}"
fi
if [ "$(find "${logs_folder}" -maxdepth 1 -type f | wc -l)" -gt 0 ]; then
echo "Cleaning logs folder..."

View file

@ -103,7 +103,6 @@ fi
kill_watcher
# Configure Tipi
"${ROOT_FOLDER}/scripts/configure.sh"
chmod -R a+rwx "${ROOT_FOLDER}/state/events"
chmod -R a+rwx "${ROOT_FOLDER}/state/system-info.json"
"${ROOT_FOLDER}/scripts/watcher.sh" &

View file

@ -7,7 +7,15 @@ WATCH_FILE="${ROOT_FOLDER}/state/events"
function clean_events() {
echo "Cleaning events..."
# Create the file if it doesn't exist
if [[ ! -f "${WATCH_FILE}" ]]; then
touch "${WATCH_FILE}"
fi
echo "" >"$WATCH_FILE"
chmod -R a+rwx "${ROOT_FOLDER}/state/events"
}
function set_status() {