Use $SHELL environment variable to run the shell scripts.
[whenjobs.git] / daemon / daemon.ml
index 1155f50..6f5edfb 100644 (file)
@@ -357,8 +357,10 @@ and run_job job =
     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)
     );