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 <arksine.code@gmail.com>
This commit is contained in:
parent
7e35e54a71
commit
06279d0e10
|
@ -11,10 +11,8 @@ GCODE_PATH="${HOME}/gcode_files"
|
||||||
MOOONRAKER_CONF="${CONFIG_PATH}/moonraker.conf"
|
MOOONRAKER_CONF="${CONFIG_PATH}/moonraker.conf"
|
||||||
MOONRAKER_LOG="${LOG_PATH}/moonraker.log"
|
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
|
[ ! -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 "${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
|
sudo systemctl stop moonraker
|
||||||
|
|
||||||
|
@ -24,8 +22,8 @@ sudo systemctl stop moonraker
|
||||||
mkdir ${DATA_PATH}
|
mkdir ${DATA_PATH}
|
||||||
|
|
||||||
echo "Creating symbolic links..."
|
echo "Creating symbolic links..."
|
||||||
ln -s ${DB_PATH} "$DATA_PATH/database"
|
[ -f "${DB_PATH}/data.mdb" ] && ln -s ${DB_PATH} "$DATA_PATH/database"
|
||||||
ln -s ${GCODE_PATH} "$DATA_PATH/gcodes"
|
[ -d "${GCODE_PATH}" ] && ln -s ${GCODE_PATH} "$DATA_PATH/gcodes"
|
||||||
ln -s ${LOG_PATH} "$DATA_PATH/logs"
|
ln -s ${LOG_PATH} "$DATA_PATH/logs"
|
||||||
ln -s ${CONFIG_PATH} "$DATA_PATH/config"
|
ln -s ${CONFIG_PATH} "$DATA_PATH/config"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue