Skip to content

Commit

Permalink
Don't hardcode /opt/fpp path so new commands work on a MAC
Browse files Browse the repository at this point in the history
References #1762
  • Loading branch information
cpinkham committed Jan 24, 2024
1 parent 2965265 commit 609c3ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/EventCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ SwitchToPlayerModeCommand::SwitchToPlayerModeCommand() :
Command("Switch To Player Mode", "Restart FPP in Player Mode.") {
}
std::unique_ptr<Command::Result> SwitchToPlayerModeCommand::run(const std::vector<std::string>& args) {
system("/opt/fpp/scripts/common setSetting fppMode player");
std::string cmd(getFPPDDir("/scripts/common setSetting fppMode player"));
system(cmd.c_str());
ShutdownFPPD(true);
return std::make_unique<Command::Result>("Switch To Player Mode");
}
Expand All @@ -403,7 +404,8 @@ SwitchToRemoteModeCommand::SwitchToRemoteModeCommand() :
Command("Switch To Remote Mode", "Restart FPP in Remote Mode.") {
}
std::unique_ptr<Command::Result> SwitchToRemoteModeCommand::run(const std::vector<std::string>& args) {
system("/opt/fpp/scripts/common setSetting fppMode remote");
std::string cmd(getFPPDDir("/scripts/common setSetting fppMode remote"));
system(cmd.c_str());
ShutdownFPPD(true);
return std::make_unique<Command::Result>("Switch To Remote Mode");
}
Expand Down

0 comments on commit 609c3ef

Please sign in to comment.