mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
network_service.cpp: acitve menu only if binary available (tiny fix)
Origin commit data
------------------
Branch: ni/coolstream
Commit: 40941dd949
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-07-13 (Fri, 13 Jul 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -51,8 +51,8 @@ struct network_service
|
|||||||
#define SERVICE_COUNT 4
|
#define SERVICE_COUNT 4
|
||||||
static struct network_service services[SERVICE_COUNT] =
|
static struct network_service services[SERVICE_COUNT] =
|
||||||
{
|
{
|
||||||
{ "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_TELNET, "", 0 },
|
{ "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, "", 0 },
|
||||||
{ "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_FTPD, "", 0 },
|
{ "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, "", 0 },
|
||||||
{ "DjMount", "djmount", "-o iocharset=utf8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 },
|
{ "DjMount", "djmount", "-o iocharset=utf8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 },
|
||||||
{ "uShare", "ushare", "-D", LOCALE_MENU_HINT_NET_USHARE, "", 0 }
|
{ "uShare", "ushare", "-D", LOCALE_MENU_HINT_NET_USHARE, "", 0 }
|
||||||
};
|
};
|
||||||
@@ -144,16 +144,17 @@ int CNetworkServiceSetup::showNetworkServiceSetup()
|
|||||||
|
|
||||||
//telnetd used inetd
|
//telnetd used inetd
|
||||||
bool useinetd = false;
|
bool useinetd = false;
|
||||||
char line[256];
|
char *buf=NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
FILE* fd = fopen("/etc/inetd.conf", "r");
|
FILE* fd = fopen("/etc/inetd.conf", "r");
|
||||||
if(fd)
|
if(fd)
|
||||||
{
|
{
|
||||||
while(!feof(fd))
|
while(!feof(fd))
|
||||||
{
|
{
|
||||||
fgets(line, 255, fd);
|
if(getline(&buf, &len, fd)!=-1)
|
||||||
{
|
{
|
||||||
if (strstr(line, "telnetd") != NULL)
|
if (strstr(buf, "telnetd") != NULL)
|
||||||
{
|
{
|
||||||
useinetd = true;
|
useinetd = true;
|
||||||
break;
|
break;
|
||||||
@@ -161,10 +162,12 @@ int CNetworkServiceSetup::showNetworkServiceSetup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
if(buf)
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
//set active when found
|
//set active when found
|
||||||
int active;
|
bool active;
|
||||||
|
|
||||||
for(unsigned i = 0; i < SERVICE_COUNT; i++) {
|
for(unsigned i = 0; i < SERVICE_COUNT; i++) {
|
||||||
items[i] = new CNetworkService(services[i].cmd, services[i].options);
|
items[i] = new CNetworkService(services[i].cmd, services[i].options);
|
||||||
|
Reference in New Issue
Block a user