File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,18 @@ install_cleanup_trap
8
8
9
9
BUNDLED="OctoPrint-FileCheck OctoPrint-FirmwareCheck OctoPrint-PiSupport"
10
10
11
+ USER=pi
12
+ VENV=/opt/octopi/oprint
13
+ [ -f $VENV ] || VENV=/home/pi/oprint
14
+
11
15
if [ -n "$OCTOPRINT_VERSION" ]; then
12
16
# fetch from GitHub since PyPI might not yet be synced through right after a fresh release
13
- sudo -u pi /home/pi/oprint /bin/pip install -U https://github.com/OctoPrint/OctoPrint/archive/refs/tags/$OCTOPRINT_VERSION.zip $BUNDLED
17
+ sudo -u $USER $VENV /bin/pip install -U https://github.com/OctoPrint/OctoPrint/archive/refs/tags/$OCTOPRINT_VERSION.zip $BUNDLED
14
18
else
15
- sudo -u pi /home/pi/oprint /bin/pip install -U OctoPrint $BUNDLED
19
+ sudo -u $USER $VENV /bin/pip install -U OctoPrint $BUNDLED
16
20
fi
17
21
18
22
# make sure to mark the file check wizard as seen
19
23
if [ $(/usr/local/bin/yq '.server.seenWizards.file_check' /home/pi/.octoprint/config.yaml) == "null" ]; then
20
- sudo -u pi FILECHECK_WIZARD=$(sudo -u pi /home/pi/oprint /bin/python -c "import octoprint_file_check; print(octoprint_file_check.WIZARD_VERSION)") /usr/local/bin/yq -i '.server.seenWizards.file_check = env(FILECHECK_WIZARD)' /home/pi/.octoprint/config.yaml
24
+ sudo -u $USER FILECHECK_WIZARD=$(sudo -u $USER $VENV /bin/python -c "import octoprint_file_check; print(octoprint_file_check.WIZARD_VERSION)") /usr/local/bin/yq -i '.server.seenWizards.file_check = env(FILECHECK_WIZARD)' /home/pi/.octoprint/config.yaml
21
25
fi
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export LC_ALL=C
6
6
source /common.sh
7
7
install_cleanup_trap
8
8
9
- apt-get install --yes --reinstall raspberrypi-bootloader raspberrypi-kernel
9
+ apt-get install --yes raspberrypi-bootloader raspberrypi-kernel
10
10
11
11
kernel_version=$(dpkg -s raspberrypi-kernel | grep -i version | awk '{print $2}')
12
12
if [ "$kernel_version" = "1:1.20230317-1" ]; then
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ install_cleanup_trap
10
10
[ -f /opt/mjpg-streamer/input_raspi.so ] && exit 0
11
11
12
12
# if we already have the octopi.txt file updated, we don't need to do anything
13
- grep -q '### Configure which camera to use' /boot /octopi.txt || exit 0
13
+ grep -q '### Configure which camera to use' $BOOT_PATH /octopi.txt || exit 0
14
14
15
- cp /files/octopi.txt /boot /octopi.txt
15
+ cp /files/octopi.txt $BOOT_PATH /octopi.txt
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ export LC_ALL=C
6
6
source /common.sh
7
7
install_cleanup_trap
8
8
9
- # if we already have the octopi.txt file updated, we don't need to do anything
9
+ # if there's no welcome script at /home/pi/scripts/welcome, we don't need to do anything
10
+ [ ! -f '/home/pi/scripts/welcome' ] && exit 0
11
+
12
+ # if we already have the file updated, we don't need to do anything
10
13
grep -q 'from octoprint._version import' /home/pi/scripts/welcome || exit 0
11
14
12
15
sed -i 's#^_OCTOPRINT_VERSION=.*$#_OCTOPRINT_VERSION=$($HOME/oprint/bin/python -c "from octoprint.util.version import get_octoprint_version_string; print(get_octoprint_version_string())" || echo "unknown")#' /home/pi/scripts/welcome
You can’t perform that action at this time.
0 commit comments