fix: create default folders [skip ci]
This commit is contained in:
parent
c67d92bdec
commit
98c86e0bcf
3 changed files with 14 additions and 1 deletions
|
@ -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..."
|
||||
|
||||
|
|
|
@ -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" &
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue