we need to open ethernet tunnel as root, so check it
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 27 Aug 2009 18:57:46 +0000 (18:57 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 27 Aug 2009 18:57:46 +0000 (18:57 +0000)
lib/PXElator/ssh.pm

index 0b67bd9..e611a0a 100644 (file)
@@ -1,12 +1,15 @@
 package ssh;
 
 use Net::OpenSSH;
+use English;
 
 my $id = 2;
 
 sub ethernet_bridge_to {
        my $host = shift;
 
+       die "you need to run this as root\n" unless $UID == 0;
+
        warn "# reset local IP address";
        system "ifconfig virtual 172.16.10.$id";