This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ checkpid () {
169
169
local PIDFILE=" ${PIDFILE:- ${0} .pid} "
170
170
if [ ! -d " /proc/$$ " ]; then
171
171
quit " ERROR" " This function requires procfs. Are you on Linux?"
172
- elif [ -f " ${PIDFILE} " ] && [ " $( cat " ${PIDFILE} " 2> /dev/null) " ! = " $$ " ] ; then
172
+ elif [ -f " ${PIDFILE} " ] && [ " $( cat " ${PIDFILE} " 2> /dev/null) " = = " $$ " ] ; then
173
173
quit " WARN" " This script is already running with PID $( cat " ${PIDFILE} " 2> /dev/null) , exiting"
174
174
else
175
175
echo -n " $$ " > " ${PIDFILE} "
@@ -185,10 +185,10 @@ requireuser () {
185
185
local REQUIREUSER=" ${1:- ${REQUIREUSER:- } } "
186
186
if [ -z " ${REQUIREUSER:- } " ] ; then
187
187
quit " ERROR" " requireuser was called, but \$ REQUIREUSER is not set"
188
- elif [ " $REQUIREUSER " != " $EUID " ] ; then
188
+ elif [ " $REQUIREUSER " != " $USER " ] ; then
189
189
quit " ERROR" " Only $REQUIREUSER is allowed to run this script"
190
190
else
191
- log " DEBUG" " User '$EUID ' matches '$REQUIREUSER ' and is allowed to run this script"
191
+ log " DEBUG" " User '$USER ' matches '$REQUIREUSER ' and is allowed to run this script"
192
192
fi
193
193
}
194
194
You can’t perform that action at this time.
0 commit comments