Fix detection of forgehook user
This commit is contained in:
parent
54ab642da2
commit
9287d77fad
8
webhook
8
webhook
|
@ -2,9 +2,11 @@
|
|||
|
||||
# Auto-detect owner of webhook-backend on current system
|
||||
# stat has different syntax on various system so we use find
|
||||
# TODO: if we don't find webhook-backend, we should error
|
||||
bin="$(which webhook-backend)"
|
||||
owner=$(find $bin -maxdepth 0 -printf '%u')
|
||||
owner=$(find /usr/local/bin/webhook-backend -maxdepth 0 -printf '%u')
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "FATAL ERROR: webhook-backend not found in /usr/local/bin"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Start the backend escalating privileges to its owner
|
||||
# TODO: introduce timeout on a dummy sudo to check sudo rules
|
||||
|
|
Reference in New Issue