summaryrefslogtreecommitdiff
path: root/openwrt/rhctl/files
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/rhctl/files')
-rw-r--r--openwrt/rhctl/files/rhctl.config12
-rw-r--r--openwrt/rhctl/files/serialclient.init18
-rwxr-xr-xopenwrt/rhctl/files/switchctl.init8
-rw-r--r--openwrt/rhctl/files/udev.init25
-rw-r--r--openwrt/rhctl/files/udev.rules7
5 files changed, 56 insertions, 14 deletions
diff --git a/openwrt/rhctl/files/rhctl.config b/openwrt/rhctl/files/rhctl.config
index 79f5ce3..1b14f04 100644
--- a/openwrt/rhctl/files/rhctl.config
+++ b/openwrt/rhctl/files/rhctl.config
@@ -1,7 +1,7 @@
config 'switchctl'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '19200'
- option device '/dev/audioswatch'
+ option device '/dev/audioswitch'
option config '/etc/rhctl/switchctl.conf'
option mode 'master'
option channel 'main'
@@ -12,7 +12,7 @@ config 'serialclient'
option log 'syslog:3,serialclient-master,daemon'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '38400'
- option device '/dev/ttyUSB0'
+ option device '/dev/ttyMaster'
option type 'master'
config 'serialclient'
@@ -21,5 +21,11 @@ config 'serialclient'
option log 'syslog:3,serialclient-standby,daemon'
option command_sock '/var/run/rhctl/switchctl.sock'
option baudrate '38400'
- option device '/dev/ttyUSB1'
+ option device '/dev/ttyStandby'
option type 'standby'
+
+config 'heartbeatclient'
+ option disabled 1
+ option command_sock '/var/run/rhctl/switchctl.sock'
+ option baudrate '38400'
+ option device '/dev/ttyHeartbeat'
diff --git a/openwrt/rhctl/files/serialclient.init b/openwrt/rhctl/files/serialclient.init
index d869d25..39665b2 100644
--- a/openwrt/rhctl/files/serialclient.init
+++ b/openwrt/rhctl/files/serialclient.init
@@ -17,7 +17,7 @@ option_cb() {
}
foreach_config_forced() {
- foreach_config $1 "forced"
+ foreach_config $1 "$2" "forced"
}
foreach_config() {
@@ -28,16 +28,20 @@ foreach_config() {
local args=""
local forced=0
- if [ -n "$2" ] && [ "x$2" == "xforced" ]; then
+ config_get name "$cfg" "name"
+ if [ -n "$2" ] && [ "x$2" != "x$name" ]; then
+ return
+ fi
+
+ if [ -n "$3" ] && [ "x$3" == "xforced" ]; then
forced=1
fi
- config_get name "serialclient" "name"
for option in $CONFIG_OPTIONS
do
- config_get value "serialclient" "$option"
+ config_get value "$cfg" "$option"
if [ "x$option" == "xdisabled" ]; then
- if [ $forced -eq 0 ] && [ $value -eq 1 ]; then
+ if [ $forced -eq 0 ] && [ -n "$value" ] && [ $value -eq 1 ]; then
echo -n " $name(disabled)"
return
fi
@@ -78,11 +82,11 @@ start() {
config_load "rhctl"
if [ $# -gt 0 ]; then
while [ $# -gt 0 ]; do
- config_foreach foreach_config_forced "$1"
+ config_foreach foreach_config_forced "serialclient" "$1"
shift
done
else
- config_foreach foreach_config ""
+ config_foreach foreach_config "serialclient"
fi
echo "."
}
diff --git a/openwrt/rhctl/files/switchctl.init b/openwrt/rhctl/files/switchctl.init
index c947e40..24ed62f 100755
--- a/openwrt/rhctl/files/switchctl.init
+++ b/openwrt/rhctl/files/switchctl.init
@@ -24,7 +24,7 @@ start_daemon() {
for option in $CONFIG_OPTIONS
do
- config_get value "switchctl" "$option"
+ config_get value "$1" "$option"
option=`echo $option | tr '_' '-'`
if [ -n "$value" ]; then
args="$args --$option $value"
@@ -32,7 +32,7 @@ start_daemon() {
done
local status="OK"
$DAEMON --write-pid $PIDFILE $args || status="failed"
- echo -n "($status)"
+ echo -n " ($status)"
}
start() {
@@ -48,9 +48,9 @@ stop() {
if [ -f $PIDFILE ]; then
kill `cat $PIDFILE` > /dev/null 2>&1
rm -f $PIDFILE > /dev/null 2>&1
- echo -n " Ok"
+ echo -n " (Ok)"
else
- echo -n " not running"
+ echo -n " (not running)"
fi
echo "."
}
diff --git a/openwrt/rhctl/files/udev.init b/openwrt/rhctl/files/udev.init
new file mode 100644
index 0000000..76796fe
--- /dev/null
+++ b/openwrt/rhctl/files/udev.init
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+START=69
+
+BIN=udevd
+DAEMON=/sbin/$BIN
+TRIGGER=/sbin/udevtrigger
+SETTLE=/sbin/udevsettle
+OPTIONS="--daemon"
+DESC=$BIN
+
+start() {
+ echo -n "Starting $DESC:"
+ $DAEMON $OPTIONS
+ echo -n " triggering .. "
+ $TRIGGER
+ echo -n " wait for settle"
+ $SETTLE
+ echo " ."
+}
+
+stop() {
+ echo -n "Stopping $DESC:"
+ killall $BIN
+ echo " ."
+}
diff --git a/openwrt/rhctl/files/udev.rules b/openwrt/rhctl/files/udev.rules
new file mode 100644
index 0000000..1723ace
--- /dev/null
+++ b/openwrt/rhctl/files/udev.rules
@@ -0,0 +1,7 @@
+# rhctl usb-serial rules
+#
+
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE2BB18", SYMLINK+="ttyMaster"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE2BI9E", SYMLINK+="ttyHeartbeat"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="ftE27L3P", SYMLINK+="ttyStandby"
+SUBSYSTEMS=="usb-serial", KERNELS=="ttyUSB*", DRIVERS=="pl2303", SYMLINK+="audioswitch"