Skip to content

Commit 2a24cf1

Browse files
committed
Fix user-fix script
It was still referring to the now non existent webcamd, causing it to fail and thus become non functional.
1 parent 2031fb8 commit 2a24cf1

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

scripts/80-install-user-fix

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

9-
# if we already have the user-fix installed, we don't need to do anything
10-
[ -f '/root/bin/user-fix' ] && exit 0
11-
129
# we need to install virtualenv-tools3, so let's get pip and that
1310
apt install -y python3-pip
1411
sudo -u pi pip3 install --user virtualenv-tools3

scripts/files/user-fix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then
1414

1515
# first we need to figure out if we can use the new user name in systemd files
1616
# directly or if we need to use the UID - we do that by checking if the
17-
# escaped name differes from the plain name, if so something is non ASCII
17+
# escaped name differs from the plain name, if so something is non ASCII
1818
# and the UID is the safer bet
1919
FIRSTUSERESC=`systemd-escape "$FIRSTUSER"`
2020
if [ "$FIRSTUSER" != "$FIRSTUSERESC" ]; then
@@ -29,6 +29,11 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then
2929
sed -i "s!ExecStart=/home/pi/!ExecStart=$FIRSTUSERHOME/!g" /etc/systemd/system/octoprint.service
3030
systemctl daemon-reload
3131

32+
# fix virtualenv
33+
echo "Fixing paths in virtual environment"
34+
cd $FIRSTUSERHOME/oprint
35+
sudo -u $FIRSTUSER $FIRSTUSERHOME/.local/bin/virtualenv-tools --update-path $FIRSTUSERHOME/oprint
36+
3237
# fix sudoers files
3338
echo "Fixing sudoers"
3439
sed -i "s!^pi!$FIRSTUSER!g" /etc/sudoers.d/octoprint-service
@@ -39,12 +44,6 @@ if [ "$CURRENT" = "pi" -a "$FIRSTUSER" != "pi" ]; then
3944
sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/add-octoprint-checkout
4045
sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/scripts/welcome
4146
sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" $FIRSTUSERHOME/.bashrc
42-
sed -i "s!/home/pi/!$FIRSTUSERHOME/!g" /root/bin/webcamd
43-
44-
# fix virtualenv
45-
echo "Fixing paths in virtual environment"
46-
cd $FIRSTUSERHOME/oprint
47-
sudo -u $FIRSTUSER $FIRSTUSERHOME/.local/bin/virtualenv-tools --update-path $FIRSTUSERHOME/oprint
4847

4948
# finally, reboot for all of this to actually take affect
5049
echo "Adjusted scripts to new user, restarting services..."

0 commit comments

Comments
 (0)