diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2018-01-24 21:59:42 -0600 |
---|---|---|
committer | Raptor Engineering Development Team <support@raptorengineering.com> | 2018-04-28 20:52:15 -0500 |
commit | 4a25768086406abef11b184098c6359aafffd0ea (patch) | |
tree | 1c2ae5a9e3f5609bdbf9b6f5ab67d633bd4b7292 /control/main.cpp | |
parent | 9d50046d54cd2c1ff340ef33d259522d2ca8a0b8 (diff) | |
download | phosphor-fan-presence-4a25768086406abef11b184098c6359aafffd0ea.tar.gz phosphor-fan-presence-4a25768086406abef11b184098c6359aafffd0ea.zip |
Add fan shutdown option to stop rotors after chassis powerdown
Diffstat (limited to 'control/main.cpp')
-rw-r--r-- | control/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/control/main.cpp b/control/main.cpp index cde71d0..dd49c93 100644 --- a/control/main.cpp +++ b/control/main.cpp @@ -1,5 +1,6 @@ /** * Copyright © 2017 IBM Corporation + * Copyright © 2017-2018 Raptor Engineering, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +45,10 @@ int main(int argc, char* argv[]) { mode = Mode::control; } + else if (args["shutdown"] == "true") + { + mode = Mode::shutdown; + } else { args.usage(argv); @@ -72,6 +77,12 @@ int main(int argc, char* argv[]) manager.doInit(); return 0; } + //Shutdown mode will disable fans and exit + else if (mode == Mode::shutdown) + { + manager.doShutdown(); + return 0; + } else { r = sd_event_loop(eventPtr.get()); |