Skip to content

Commit 609c3ef

Browse files
committed
Don't hardcode /opt/fpp path so new commands work on a MAC
References #1762
1 parent 2965265 commit 609c3ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/EventCommands.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ SwitchToPlayerModeCommand::SwitchToPlayerModeCommand() :
394394
Command("Switch To Player Mode", "Restart FPP in Player Mode.") {
395395
}
396396
std::unique_ptr<Command::Result> SwitchToPlayerModeCommand::run(const std::vector<std::string>& args) {
397-
system("/opt/fpp/scripts/common setSetting fppMode player");
397+
std::string cmd(getFPPDDir("/scripts/common setSetting fppMode player"));
398+
system(cmd.c_str());
398399
ShutdownFPPD(true);
399400
return std::make_unique<Command::Result>("Switch To Player Mode");
400401
}
@@ -403,7 +404,8 @@ SwitchToRemoteModeCommand::SwitchToRemoteModeCommand() :
403404
Command("Switch To Remote Mode", "Restart FPP in Remote Mode.") {
404405
}
405406
std::unique_ptr<Command::Result> SwitchToRemoteModeCommand::run(const std::vector<std::string>& args) {
406-
system("/opt/fpp/scripts/common setSetting fppMode remote");
407+
std::string cmd(getFPPDDir("/scripts/common setSetting fppMode remote"));
408+
system(cmd.c_str());
407409
ShutdownFPPD(true);
408410
return std::make_unique<Command::Result>("Switch To Remote Mode");
409411
}

0 commit comments

Comments
 (0)