close_out chan;
chmod script 0o700;
+ let shell = try getenv "SHELL" with Not_found -> "/bin/sh" in
+
(* Execute the shell script. *)
- (try execvp "bash" [| "bash"; "-c"; script |];
+ (try execvp shell [| shell; "-c"; script |];
with Unix_error (err, fn, _) ->
Syslog.error "%s failed: %s: %s" fn script (error_message err)
);