mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
helpers: add getBoxMode() function
Origin commit data
------------------
Commit: 3dc8822e9b
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-03-14 (Sun, 14 Mar 2021)
Origin message was:
------------------
- helpers: add getBoxMode() function
This commit is contained in:
@@ -2006,6 +2006,29 @@ bool isDigitWord(std::string str)
|
||||
return true;
|
||||
}
|
||||
|
||||
int getBoxMode()
|
||||
{
|
||||
int boxmode = -1;
|
||||
|
||||
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7
|
||||
FILE *f = fopen("/proc/cmdline", "r");
|
||||
if (f)
|
||||
{
|
||||
char buf[256] = "";
|
||||
while(fgets(buf, sizeof(buf), f) != NULL)
|
||||
{
|
||||
if (strstr(buf, "boxmode=12") != NULL)
|
||||
boxmode = 12;
|
||||
else
|
||||
boxmode = 1;
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
return boxmode;
|
||||
}
|
||||
|
||||
int getActivePartition()
|
||||
{
|
||||
int c = -1;
|
||||
|
Reference in New Issue
Block a user