Browse Source

Improvements

MissValeska 9 years ago
parent
commit
66500c1c2c
2 changed files with 20 additions and 5 deletions
  1. 1
    1
      src/netsukuku.c
  2. 19
    4
      src/scripts/ntk-wifi

+ 1
- 1
src/netsukuku.c View File

@@ -437,7 +437,7 @@ parse_options(int argc, char **argv)
437 437
 
438 438
 		switch (c) {
439 439
                 case 'n':
440
-                    printf("netsplit argument: %s", optarg);
440
+                    printf("netsplit argument: %s\n", optarg);
441 441
                     if(strcmp("inet", optarg) == 0 || strcmp("INET", optarg) == 0)
442 442
                         netsplit.netsplit_inet_mode = 1;
443 443
                     if(strcmp("ntk", optarg) == 0 || strcmp("NTK", optarg) == 0)

+ 19
- 4
src/scripts/ntk-wifi View File

@@ -1,10 +1,14 @@
1 1
 #!/bin/sh
2
-# ntk-wifi: sets a wifi card in Ad-Hoc mode and its essid to "netsukuku".
2
+# ntk-wifi: sets a wifi card in ad-hoc mode and its essid to "netsukuku".
3 3
 
4 4
 if test -z "$1" -o "$1" = "help" -o "$1" = "-h" -o "$1" = "--help"
5 5
 then
6 6
 	echo "You must specify your wifi interface."
7 7
 	echo "Ex: ntk-wifi wlan0"
8
+	echo "Optional arguments:"
9
+	echo "-u --undo Reverts the effect of this script"
10
+	echo "You may need to turn your interface off and on in your network manager"
11
+	echo "E.G: Clicking the wifi icon and hitting off and then hitting on after"
8 12
 	exit 1
9 13
 fi
10 14
 
@@ -17,10 +21,21 @@ fi
17 21
 
18 22
 wlan=$1
19 23
 
20
-echo "* Setting $wlan in \"Ad-Hoc\" mode with essid \"netsukuku\":"
21
-echo "    iwconfig $wlan mode Ad-Hoc essid netsukuku"
24
+echo "$2"
22 25
 
23
-if ! iwconfig $wlan mode Ad-Hoc essid netsukuku
26
+if $2 == "-u" $2 == "--undo"
27
+then
28
+iwconfig $wlan mode managed
29
+ifconfig $wlan down
30
+ifconfig $wlan up
31
+exit 0
32
+fi
33
+
34
+
35
+echo "* Setting $wlan in \"ad-hoc\" mode with essid \"netsukuku\":"
36
+echo "    iwconfig $wlan mode ad-hoc essid netsukuku"
37
+
38
+if ! iwconfig $wlan mode ad-hoc essid netsukuku
24 39
 then
25 40
 	echo "[!] iwconfig failed."
26 41
 	echo "Retry manually with: "

Loading…
Cancel
Save