From 06279d0e10ae4e0349f7b415756821d7ca38774b Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sun, 16 Oct 2022 07:53:51 -0400 Subject: [PATCH] data-path-fix: update for fresh installs Don't require the database and gcode paths to exist. Fall back on the default location if they do not. Signed-off-by: Eric Callahan --- scripts/data-path-fix.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/data-path-fix.sh b/scripts/data-path-fix.sh index 553e6c1..7f4d7c1 100755 --- a/scripts/data-path-fix.sh +++ b/scripts/data-path-fix.sh @@ -11,10 +11,8 @@ GCODE_PATH="${HOME}/gcode_files" MOOONRAKER_CONF="${CONFIG_PATH}/moonraker.conf" MOONRAKER_LOG="${LOG_PATH}/moonraker.log" -[ ! -d "${DB_PATH}" ] && echo "Error: unable to find database: ${DB_PATH}" && exit 1 [ ! -f "${MOOONRAKER_CONF}" ] && echo "Error: unable to find config: ${MOOONRAKER_CONF}" && exit 1 [ ! -d "${LOG_PATH}" ] && echo "Error: unable to find log path: ${LOG_PATH}" && exit 1 -[ ! -d "${GCODE_PATH}" ] && echo "Error: unable to find gcode path: ${GCODE_PATH}" && exit 1 sudo systemctl stop moonraker @@ -24,8 +22,8 @@ sudo systemctl stop moonraker mkdir ${DATA_PATH} echo "Creating symbolic links..." -ln -s ${DB_PATH} "$DATA_PATH/database" -ln -s ${GCODE_PATH} "$DATA_PATH/gcodes" +[ -f "${DB_PATH}/data.mdb" ] && ln -s ${DB_PATH} "$DATA_PATH/database" +[ -d "${GCODE_PATH}" ] && ln -s ${GCODE_PATH} "$DATA_PATH/gcodes" ln -s ${LOG_PATH} "$DATA_PATH/logs" ln -s ${CONFIG_PATH} "$DATA_PATH/config"