"Jim - FooBar();" <[email protected]> writes: > --------------------------------------------------------------------------------------------------------------------------------- > (defn shutdown-pc [root-pwd minutes-after] > (let [op-system (System/getProperty "os.name") > enviroment (Runtime/getRuntime)] > (cond > (or (.startsWith op-system "Linux") > (.startsWith op-system "Mac OS")) > (.exec enviroment (str "echo " root-pwd " |" " sudo -S > shutdown -h +" minutes-after)) > (.startsWith op-system "Windows") > (.exec enviroment (str "shutdown -s -t " minutes-after)) > :else (throw (RuntimeException. "Unsupported operating system!")))) > ----------------------------------------------------------------------------------------------------------------------------------
You should checkout proces output to make sure, but I'm betting that sudo is opening a tty to read the password and not getting it from stdout. The properly solution here, here, may be to define shutdown as a sudo action for your user ID which does not require a password. -- Craig Brozefsky <[email protected]> Premature reification is the root of all evil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
