This commit is contained in:
2025-09-28 16:31:50 +08:00
parent 8587e5c84a
commit 0eb94c9e11
10 changed files with 171 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
/*
本程序为BSD服务启动程序,主要用于进行BSD系统的服务启动
*/
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
if (argc != 2)
{
cout << "Using:./start start/stop" << endl;
return -1;
}
string commnd = "";
string action(argv[1]);
if (action == "start")
{
commnd = "echo 'orangepi' | sh /home/orangepi/RKApp/StartService/bin/start.sh";
}
else if(action == "stop")
{
commnd = "echo 'orangepi' | sh /home/orangepi/RKApp/StartService/bin/stop.sh";
}
else
{
cout << "Unknown action: " << action << "\nUsing: ./start start|stop" << endl;
return -1;
}
system(commnd.c_str());
return 0;
}