Skip to content

Commit

Permalink
Merge pull request #2857 from rleidner/soc_vwid_p20
Browse files Browse the repository at this point in the history
soc_vwid: main.sh - always execute as user pi
  • Loading branch information
benderl authored Dec 2, 2024
2 parents aa2a2a0 + ea5f306 commit 49dabaf
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 $*"
exit $?
fi
# -- ending user pi enforcement

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

0 comments on commit 49dabaf

Please sign in to comment.