summaryrefslogtreecommitdiff
path: root/package/soloscli/files/etc/hotplug.d/atm/15-solos-init
blob: 36d13ea5a01a84fc4b1da15b00781f116499ea5e (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
26
#!/bin/sh

dialog() {
	local tag="$(echo "$1" | cut -d= -f1)"
	local value="$(echo "$1" | cut -d= -f2-)"
	local response
	
	response="$(soloscli -s "$port" "$tag" "$value")"
	[ $? -ne 0 ] && {
		logger "soloscli($port): $tag '$value' returns $response"
	}
}

if [ "$ACTION" = "add" ]; then
	include /lib/network
	scan_interfaces

	case $DEVICENAME in
	solos-pci[0-3])
		port="${DEVICENAME#solos-pci}"
		device="solos${port}"

		config_list_foreach wan "$device" dialog
		;;
	esac
fi