I have the following function in bash, who was previously in the case part of a switch, but no matter where I put it I always get a syntax error
do_start(){
if[f $PIDFILE]; then
echo "supervisord already running: $PIDFILE" exit 1
fi
log_begin_msg "Starting Supervisor daemon manager..."
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $SUPERVISORD -- $OPTS || log_end_msg 1
log_end_msg 0
}
and I get:
runScript.sh: Syntax error: "then" unexpected (expecting "}")
I don't know what is going on please help