Skip to content

Commit f820e3b

Browse files
committed
fix: replace problematic lines in user-fix vs replace file
Makes this compatible to both OctoPi 1.0.0 and 1.1.0.
1 parent 82ade6b commit f820e3b

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

scripts/80-install-user-fix

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
# this is intentionally commented out because our user-fix script has
10-
# to be changed compared the one already shipping with OctoPi
11-
#[ -f '/root/bin/user-fix' ] && exit 0
9+
if [ -f '/root/bin/user-fix' ]; then
10+
# user-fix is already there, make sure that no reference to webcamd remains
11+
sed -i "/\/root\/bin\/webcamd/d" /root/bin/user-fix
12+
else
13+
# we need to install virtualenv-tools3, so let's get pip and that
14+
apt-get install -y python3-pip
15+
sudo -u pi pip3 install --user virtualenv-tools3
1216

13-
# we need to install virtualenv-tools3, so let's get pip and that
14-
apt-get install -y python3-pip
15-
sudo -u pi pip3 install --user virtualenv-tools3
17+
cp /files/user-fix /root/bin/user-fix
18+
chmod +x /root/bin/user-fix
1619

17-
cp /files/user-fix /root/bin/user-fix
18-
chmod +x /root/bin/user-fix
19-
20-
cp /files/user-fix.service /etc/systemd/system/user-fix.service
21-
systemctl enable user-fix.service
20+
cp /files/user-fix.service /etc/systemd/system/user-fix.service
21+
systemctl enable user-fix.service
22+
fi

0 commit comments

Comments
 (0)