diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh index 843408a..de17df8 100755 --- a/stage1/01-sys-tweaks/00-run.sh +++ b/stage1/01-sys-tweaks/00-run.sh @@ -11,7 +11,9 @@ on_chroot << EOF if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then adduser --disabled-password --gecos "" ${FIRST_USER_NAME} fi -adduser --disabled-password --gecos "" octoprint +if ! id -u octoprint >/dev/null 2>&1; then + adduser --disabled-password --gecos "" octoprint +fi echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd echo "octoprint:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" | chpasswd echo "root:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" | chpasswd diff --git a/stage2/04-octoprint/01-run.sh b/stage2/04-octoprint/01-run.sh index bb4ea2f..1a8cc90 100755 --- a/stage2/04-octoprint/01-run.sh +++ b/stage2/04-octoprint/01-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -e -if [ -d /home/octoprint ]; +on_chroot << EOF +if [ -d /home/octoprint ]; then cd /home/octoprint || exit 1 mkdir OctoPrint || exit 1 cd OctoPrint || exit 1 @@ -8,4 +9,5 @@ if [ -d /home/octoprint ]; source venv/bin/activate || exit 1 pip install pip --upgrade || exit 1 pip install octoprint || exit 1 -fi +fi +EOF diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh index e3b6820..580ecfb 100755 --- a/stage3/00-install-packages/01-run.sh +++ b/stage3/00-install-packages/01-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -echo -n -e "NODM_USER=${FIRST_USER_NAME}\nNODM_XSESSION=/home/${FIRST_USER_NAME}/.xprofile" > /etc/nodm.conf +echo -n -e "NODM_USER=${FIRST_USER_NAME}\nNODM_XSESSION=/home/${FIRST_USER_NAME}/.xprofile" > ${ROOTFS_DIR}/etc/nodm.conf on_chroot << EOF update-alternatives --install /usr/bin/x-www-browser \ diff --git a/stage3/00-install-packages/files/nodm.conf b/stage3/00-install-packages/files/nodm.conf deleted file mode 100644 index 2c12a0f..0000000 --- a/stage3/00-install-packages/files/nodm.conf +++ /dev/null @@ -1,2 +0,0 @@ -NODM_USER=pi -NODM_XSESSION=/home/pi/.xprofile