summaryrefslogtreecommitdiffstats
path: root/target/device/valka/target_skeleton/etc/rc.d/03.hostname
blob: 5cbae3f78f6b9f1fe4a088f9211708a2df422459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/ash
. /etc/rc.subr

start() {
	echo -n " * Settings hostname: "
	if [ ! -x ${hostname_program} ]; then
		log_error "Missing 'hostname' program (${hostname_program})"
		echo "Failed"
		return 1
	fi

	if ${hostname_program} ${hostname}; then
		echo "'${hostname}'"
		echo ${hostname} > /etc/hostname
	else
		echo "Failed"
		return 1
	fi
}

stop() {
	return 0
}

rc_run_command "$1"