Skip to content

Commit 49dabaf

Browse files
authored
Merge pull request #2857 from rleidner/soc_vwid_p20
soc_vwid: main.sh - always execute as user pi
2 parents aa2a2a0 + ea5f306 commit 49dabaf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/soc_vwid/main.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
#!/bin/bash
2+
3+
# -- start user pi enforcement
4+
# normally the soc module runs as user pi
5+
# When LP Configuration is stored, it is run as user www-data
6+
# This leads to various permission problems
7+
# if actual user is not pi, this section restarts the script as user pi
8+
usr=`id -nu`
9+
if [ "$usr" != "pi" ]
10+
then
11+
sudo -u pi -c bash "$0 $*"
12+
exit $?
13+
fi
14+
# -- ending user pi enforcement
15+
216
OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd)
317
RAMDISKDIR="$OPENWBBASEDIR/ramdisk"
418
MODULEDIR=$(cd `dirname $0` && pwd)

0 commit comments

Comments
 (0)