about summary refs log tree commit diff stats
path: root/tools/conf/etc/rc.d
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-10-03 22:48:38 +0100
committerSilvino Silva <silvino@bk.ru>2016-10-03 22:49:20 +0100
commitc30b14dbcfb60418a0d7fd050a096c9bc20a380b (patch)
tree0aa945da5a98a0a1d837ff55338800d0a46db820 /tools/conf/etc/rc.d
parentcf0657e1b62b59e2f54bc0cb88870c4db1e36769 (diff)
parente6d81cddaba6e3a1583a193ddf1b7405fbdd9889 (diff)
downloaddoc-c30b14dbcfb60418a0d7fd050a096c9bc20a380b.tar.gz
Release 0.2.3
Diffstat (limited to 'tools/conf/etc/rc.d')
-rwxr-xr-xtools/conf/etc/rc.d/blan63
-rwxr-xr-xtools/conf/etc/rc.d/postgresql16
2 files changed, 79 insertions, 0 deletions
diff --git a/tools/conf/etc/rc.d/blan b/tools/conf/etc/rc.d/blan
new file mode 100755
index 0000000..f75d272
--- /dev/null
+++ b/tools/conf/etc/rc.d/blan
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# /etc/rc.d/net: start/stop network interface
+#
+
+DEV="br0"
+PHY="enp8s0"
+
+ADDR=10.0.0.1
+NET=10.0.0.0
+MASK=24
+GTW=10.0.0.1
+NTAPS=$((`/usr/bin/nproc`-1))
+
+case $1 in
+	start)
+                /sbin/ip link add name ${DEV} type bridge
+                /sbin/ip link set dev ${DEV} up
+
+                /bin/sleep 0.2s
+                /sbin/ip route flush dev ${PHY}
+                /sbin/ip addr flush dev ${PHY}
+                /sbin/ip link set dev ${PHY} master ${DEV}
+
+                /sbin/ip addr add ${ADDR}/${MASK} dev ${DEV} broadcast +
+
+                for i in `/usr/bin/seq $NTAPS`
+                do
+                    TAP="tap$i"
+                    echo $TAP
+                    /sbin/ip tuntap add ${TAP} mode tap group kvm
+                    /sbin/ip link set ${TAP} up
+                    /bin/sleep 0.2s
+                    #brctl addif $switch $1
+                    /sbin/ip link set ${TAP} master ${DEV}
+                done
+
+		exit 0
+		;;
+	stop)
+
+                for i in `/usr/bin/seq $NTAPS`
+                do
+                    TAP="tap$i"
+		    /sbin/ip link del ${TAP}
+                    echo $TAP
+                done
+
+       		/sbin/ip link set dev ${DEV} down
+		/sbin/ip route flush dev ${DEV}
+		/sbin/ip link del ${DEV}
+		exit 0
+		;;
+	restart)
+		$0 stop
+		$0 start
+		;;
+	*)
+		echo "Usage: $0 [start|stop|restart]"
+		;;
+esac
+
+# End of file
diff --git a/tools/conf/etc/rc.d/postgresql b/tools/conf/etc/rc.d/postgresql
new file mode 100755
index 0000000..5f0762a
--- /dev/null
+++ b/tools/conf/etc/rc.d/postgresql
@@ -0,0 +1,16 @@
+#
+# /etc/rc.d/postgresql: start, stop or restart PostgreSQL server postmaster
+#
+
+PG_DATA=/srv/pgsql/data
+
+case "$1" in
+    start|stop|status|restart|reload)
+        sudo -u postgres pg_ctl -D "$PG_DATA" -l /var/log/postgresql "$1"
+        ;;
+    *)
+        echo "usage: $0 start|stop|restart|reload|status"
+        ;;
+esac
+
+# End of file