fix hostname setting

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1710 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-10-29 20:05:15 +00:00
parent 8dc232646b
commit 66a7fcec9c

View File

@ -35,7 +35,7 @@ class settings {
settings method hostname {{name ""}} { settings method hostname {{name ""}} {
if {$name == ""} { if {$name == ""} {
# Get # Get
if {[catch {set fd [open "/var/lib/humaxtv/hostname" r]}]} { if {[catch {set fd [open "/var/lib/humaxtv/mod/hostname" r]}]} {
set name "humax" set name "humax"
} else { } else {
set name [string trim [read $fd]] set name [string trim [read $fd]]
@ -45,10 +45,10 @@ settings method hostname {{name ""}} {
} else { } else {
# Set # Set
if [string is alnum -strict $name] { if [string is alnum -strict $name] {
set fd [open "/var/lib/humaxtv/hostname" w] set fd [open "/var/lib/humaxtv/mod/hostname" w]
puts $fd $name puts $fd $name
close $fd close $fd
exec hostname -F /var/lib/humaxtv/hostname exec hostname -F /var/lib/humaxtv/mod/hostname
} }
} }
} }