Your problem is with spaces
You wrote
charon_id = $(pidof charon)
This means "run the command `charon_id` with two parameters; first is the `=` character and the second is the output of the `$(..)` command
It should be
charon_id=$(pidof charon)
Now you assign the output to the variable.