Skip to content

Commit

Permalink
fix external motion script to use file user owner vs runtime owner, a…
Browse files Browse the repository at this point in the history
…s motion runs as foot, and if sm not running gets file ownership wrong
  • Loading branch information
sdetweil committed Nov 3, 2021
1 parent c652cee commit 0155f87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/external_motion
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ fi
# where is this script located?
SCRIPT="$($cmd -f "$0")"
SCRIPTPATH="$(dirname "$SCRIPT")"
tofind=${SCRIPTPATH%/*}/node_modules
#tofind=${SCRIPTPATH%/*}/node_modules
# get the script file permissions, and user ownership
user=$(ls -laF $SCRIPT | awk {'print $3}')

# user that started smart-mirror should have access permissions
user=`ps aux | grep $tofind | grep -m 1 -v -- auto | awk '{ print $1}'`
#user=`ps aux | grep $tofind | grep -m 1 -v -- auto | awk '{ print $1}'`

# this script is in the scripts folder, the motion folder is back up the tree 1 level.
motiondir=${SCRIPTPATH}/../motion
Expand Down

0 comments on commit 0155f87

Please sign in to comment.