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
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ class settings {
settings method hostname {{name ""}} {
if {$name == ""} {
# 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"
} else {
set name [string trim [read $fd]]
@ -45,10 +45,10 @@ settings method hostname {{name ""}} {
} else {
# Set
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
close $fd
exec hostname -F /var/lib/humaxtv/hostname
exec hostname -F /var/lib/humaxtv/mod/hostname
}
}
}