mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
- helpers: add getBoxMode() function
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -1848,6 +1848,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;
|
||||
|
@@ -190,6 +190,7 @@ bool downloadUrl(std::string url, std::string file, const std::string userAgent
|
||||
|
||||
bool isDigitWord(std::string str);
|
||||
|
||||
int getBoxMode();
|
||||
int getActivePartition();
|
||||
|
||||
std::string GetSpecialName(std::string NormalName);
|
||||
|
Reference in New Issue
Block a user