aboutsummaryrefslogtreecommitdiffstats
path: root/util/dvbnet/net_start.pl
diff options
context:
space:
mode:
Diffstat (limited to 'util/dvbnet/net_start.pl')
-rwxr-xr-xutil/dvbnet/net_start.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/dvbnet/net_start.pl b/util/dvbnet/net_start.pl
new file mode 100755
index 0000000..71e6367
--- /dev/null
+++ b/util/dvbnet/net_start.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+$ADAPTER = 0;
+
+&dvbnet($ADAPTER, 0, 512, "192.168.11.1");
+&dvbnet($ADAPTER, 0, 2000, "192.168.21.1");
+
+
+# &dvbnet(adapter,netdev,pid,"ip_addr");
+
+sub dvbnet
+{
+ local ($ADAPTER, $NETDEV, $PID, $IP_ADDR) = @_;
+
+ $DEV_NAME = `./dvbnet -a $ADAPTER -n $NETDEV -p $PID | grep created`;
+ chop($DEV_NAME);
+
+ $DEV_NAME =~ s/(.*)device //;
+ $DEV_NAME =~ s/for (.*)//;
+
+ $X = `/sbin/ifconfig $DEV_NAME $IP_ADDR netmask 255.255.255.0`;
+
+ system("/sbin/ifconfig $DEV_NAME");
+}
+