summaryrefslogtreecommitdiff
path: root/net-misc/ser2net/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/ser2net/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/ser2net/files')
-rw-r--r--net-misc/ser2net/files/ser2net-2.7-b230400.diff20
-rw-r--r--net-misc/ser2net/files/ser2net.confd27
-rw-r--r--net-misc/ser2net/files/ser2net.initd54
3 files changed, 101 insertions, 0 deletions
diff --git a/net-misc/ser2net/files/ser2net-2.7-b230400.diff b/net-misc/ser2net/files/ser2net-2.7-b230400.diff
new file mode 100644
index 000000000000..5e567c118eac
--- /dev/null
+++ b/net-misc/ser2net/files/ser2net-2.7-b230400.diff
@@ -0,0 +1,20 @@
+--- ser2net-2.7.orig/devcfg.c 2009-10-23 14:23:25.000000000 +0200
++++ ser2net-2.7/devcfg.c 2012-07-17 21:03:49.708603108 +0200
+@@ -113,6 +113,9 @@
+ } else if (strcmp(pos, "115200") == 0) {
+ cfsetospeed(termctl, B115200);
+ cfsetispeed(termctl, B115200);
++ } else if (strcmp(pos, "230400") == 0) {
++ cfsetospeed(termctl, B230400);
++ cfsetispeed(termctl, B230400);
+ } else if (strcmp(pos, "1STOPBIT") == 0) {
+ termctl->c_cflag &= ~(CSTOPB);
+ } else if (strcmp(pos, "2STOPBITS") == 0) {
+@@ -190,6 +193,7 @@
+ case B38400: str = "38400"; break;
+ case B57600: str = "57600"; break;
+ case B115200: str = "115200"; break;
++ case B230400: str = "230400"; break;
+ default: str = "unknown speed";
+ }
+ return str;
diff --git a/net-misc/ser2net/files/ser2net.confd b/net-misc/ser2net/files/ser2net.confd
new file mode 100644
index 000000000000..c66685159348
--- /dev/null
+++ b/net-misc/ser2net/files/ser2net.confd
@@ -0,0 +1,27 @@
+# Config file for /etc/init.d/ser2net
+
+# Set the configuration file to one other than the default of /etc/ser2net.conf
+#
+#CONFIG_FILE="/etc/ser2net.conf"
+
+# Enables the control port and sets the TCP port to listen to for the control port.
+# A port number may be of the form [host,]port, such as 127.0.0.1,2000 or localhost,2000.
+# If this is specified, it will only bind to the IP address specified for the port.
+# Otherwise, it will bind to all the addresses on the machine.
+#
+#CONTROL_PORT=""
+
+# Cisco IOS uses a different mechanism for specifying the baud rates than the mechanism
+# described in RFC2217. This option sets the IOS version of setting the baud rates.
+# The default is RFC2217s.
+#
+#CISCO_IOS="yes"
+
+# Enable or disable UUCP locking (default=yes)
+#
+#UUCP_LOCKS="no"
+
+# see the ser2net(8) manual page for additional options you can configure here
+#
+#EXTRA_OPTS=""
+
diff --git a/net-misc/ser2net/files/ser2net.initd b/net-misc/ser2net/files/ser2net.initd
new file mode 100644
index 000000000000..3ce489bd1ff1
--- /dev/null
+++ b/net-misc/ser2net/files/ser2net.initd
@@ -0,0 +1,54 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Serial to network proxy (${RC_SVCNAME#*.})"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+command="/usr/sbin/ser2net"
+name="${RC_SVCNAME}"
+
+extra_started_commands="reload"
+description_reload="Reread configuration file and make the appropriate changes"
+start_stop_daemon_args="--quiet --exec ${command} --name ${name} --pidfile ${pidfile}"
+
+depend() {
+ use logger
+ need net
+}
+
+config_check() {
+ command_args="${EXTRA_OPTS}"
+ CONFIG_FILE_DEFAULT="/etc/ser2net.conf"
+
+ yesno "${CISCO_IOS:-no}" && command_args="${SER2NET_OPTS} -b"
+ yesno "${UUCP_LOCKS:-yes}" || command_args="${command_args} -u"
+ [ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}"
+ [ -n "${CONTROL_PORT}" ] && command_args="${command_args} -p ${CONTROL_PORT}"
+ [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}"
+
+ if [ ! -f "${CONFIG_FILE}" ]; then
+ eerror "Please create ${CONFIG_FILE}"
+ eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ config_check || return ${?}
+ ebegin "Starting ${description}"
+ start-stop-daemon --start ${start_stop_daemon_args} -- ${command_args} -P "${pidfile}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping ${description}"
+ start-stop-daemon --stop ${start_stop_daemon_args}
+ eend ${?}
+}
+
+reload() {
+ ebegin "Reloading ${description}"
+ start-stop-daemon --signal HUP ${start_stop_daemon_args}
+ eend ${?}
+}