mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
Hostname, #271. rcS needs hostname -F /etc/hostname before ifup
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@487 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -45,6 +45,8 @@ void CNetworkConfig::init_vars(void)
|
||||
char router[16];
|
||||
char ip[16];
|
||||
|
||||
hostname = netGetHostname();
|
||||
|
||||
netGetDefaultRoute(router);
|
||||
gateway = router;
|
||||
netGetIP((char *) "eth0", ip, mask, _broadcast);
|
||||
@@ -61,6 +63,7 @@ void CNetworkConfig::copy_to_orig(void)
|
||||
orig_broadcast = broadcast;
|
||||
orig_gateway = gateway;
|
||||
orig_inet_static = inet_static;
|
||||
orig_hostname = hostname;
|
||||
}
|
||||
|
||||
bool CNetworkConfig::modified_from_orig(void)
|
||||
@@ -71,6 +74,7 @@ bool CNetworkConfig::modified_from_orig(void)
|
||||
(orig_netmask != netmask ) ||
|
||||
(orig_broadcast != broadcast ) ||
|
||||
(orig_gateway != gateway ) ||
|
||||
(orig_hostname != hostname ) ||
|
||||
(orig_inet_static != inet_static )
|
||||
);
|
||||
}
|
||||
@@ -79,6 +83,9 @@ void CNetworkConfig::commitConfig(void)
|
||||
{
|
||||
if (modified_from_orig())
|
||||
{
|
||||
if(orig_hostname != hostname)
|
||||
netSetHostname((char *) hostname.c_str());
|
||||
|
||||
copy_to_orig();
|
||||
|
||||
if (inet_static)
|
||||
|
Reference in New Issue
Block a user