Fix bash script when running from init script