File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,22 @@ start () {
5353
5454 # running as a service, see
5555 # https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service
56- if [[ -z $runner_command ]]
56+ if [[ -z " $runner_command " ]]
5757 then
5858 runner_command=" bin/runsvc.sh"
5959 fi
6060
61+ cd " $runner_path "
62+
63+ # check if runner command is valid
64+ if ! ([[ -x " $runner_command " ]] || type " $runner_command " > /dev/null 2>&1 )
65+ then
66+ echo " Runner command $runner_command is invalid"
67+ exit 2
68+ fi
69+
6170 echo " Starting runner"
6271 echo " Starting runner on $( hostname) " >> " $state_path /$LOG_FILE "
63- cd " $runner_path "
6472 $runner_command >> " $state_path /$LOG_FILE " 2>&1 &
6573
6674 # create pid file
You can’t perform that action at this time.
0 commit comments