Skip to content

Commit

Permalink
soc_vwid: main.sh - always execute as user pi
Browse files Browse the repository at this point in the history
  • Loading branch information
rleidner committed Nov 26, 2024
1 parent b72807f commit c5e3374
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/soc_vwid/main.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
#!/bin/bash

# -- start user pi enforcement
# normally the soc module runs as user pi
# When LP Configuration is stored, it is run as user www-data
# This leads to various permission problems
# if actual user is not pi, this section restarts the script as user pi
usr=`id -nu`
if [ "$usr" != "pi" ]
then
sudo -u pi -c bash "$0 $*"

Check failure on line 11 in modules/soc_vwid/main.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
exit $?

Check failure on line 12 in modules/soc_vwid/main.sh

View workflow job for this annotation

GitHub Actions / build

.editorconfig check

Wrong indentation type(spaces instead of tabs)
fi
# -- ending user pi enforcement

OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd)
RAMDISKDIR="$OPENWBBASEDIR/ramdisk"
MODULEDIR=$(cd `dirname $0` && pwd)
Expand Down

0 comments on commit c5e3374

Please sign in to comment.