Bash script to connect to strongest unencrypted wifi AP

Here's a little bash script that looks at the available wifi APs that your card can see, and automatically connects you to the AP with the highest quality and that is also unencrypted. I'm just posting it in case anyone wants to improve upon it or use it. And yes, my bash knowledge kinda sucks.
Just call it like "wifi.sh wlan0" as root.
#!/bin/bash
# Finds the strongest unencrypted AP and tries to connect to it via dhcp
# Call this script like "wifi.sh wlan0"
interface=$1
iwlist $interface scan > blah
NumAPs=`cat blah | grep ESSID | wc -l`
BestAP=0
BestQuality=-1
for i in `seq 1 $NumAPs`;
do
# Check if AP is encrypted
Encryption=`cat blah | grep Encryption | head -n$i | tail -n1 | cut -d":" -f2`
if [ $Encryption = "off" ]; then
# Find AP with the highest quality
QUALITY=`cat blah | grep Quality | head -n$i | tail -n1 | cut -d":" -f2 | cut -d"/" -f1 | sed 's/ //g'`
if [ $QUALITY -gt $BestQuality ]; then
BestQuality=$QUALITY
BestAP=$i
fi
fi
done
if [ $BestAP -gt 0 ]; then
# Yay, we found an unencrypted AP:
echo Connecting to...
ESSID=`cat blah | grep ESSID | head -n$BestAP | tail -n1 | cut -d""" -f2`
echo ESSID=$ESSID
MODE=`cat blah | grep Mode | head -n$BestAP | tail -n1 | cut -d":" -f2`
echo Mode=$MODE
CHANNEL=`cat blah | grep Channel | head -n$BestAP | tail -n1 | cut -d"(" -f2 | sed 's/Channel //g' | sed 's/)//g'`
echo Channel=$CHANNEL
# Connect
iwconfig $interface essid $ESSID mode $MODE channel $CHANNEL
if [ -e /etc/dhcpc/dhcpcd-${interface}.pid ]; then
rm /etc/dhcpc/dhcpcd-${interface}.pid
fi
dhcpcd $interface
# Cleanup
rm blah
fi

For whatever reason, your quality line uses an equal sign whereas every other line of your scan has a colon (and most people have a colon for every line). Too weird..
Anyway, give this a shot:
#!/bin/bash
# Finds the strongest unencrypted AP and tries to connect to it via dhcp
# Call this script like "wifi.sh wlan0"
TEMP=/tmp/bestap.tmp
LOCK=/var/lock/bestap.lock
if [ `whoami` != "root" ];then
echo "Sorry, you need to be root to run this program"
exit 1
fi
if [[ -z $1 ]];then
echo "USAGE: $0 device"
exit 1
else
interface=$1
fi
# Checking for lock
if [[ -e $LOCK ]];then
exit 1; # Too simply nothing to do here :)
else
touch $TEMP $LOCK
fi
isNotInteger()
x=$1
case $x in
*[!0-9])
return 0 ;;
return 1 ;;
esac
# Proggy
iwlist $interface scan > $TEMP
NumAPs=`cat $TEMP | grep ESSID | wc -l`
BestAP=0
BestQuality=-1
for i in `seq 1 $NumAPs`;
do
# Check if AP is encrypted
Encryption=`cat $TEMP | grep Encryption | head -n$i | tail -n1 | cut -d":" -f2`
if [ $Encryption = "off" ]; then
# Find AP with the highest quality
QUALITY=`cat $TEMP | grep Quality | head -n$i | tail -n1 | cut -d":" -f2 | cut -d"/" -f1 | sed 's/ //g'`
if isNotInteger "$QUALITY"; then
# If we didn't find an integer, try this instead:
QUALITY=`cat $TEMP | grep Quality | head -n$i | tail -n1 | cut -d"=" -f2 | cut -d"/" -f1 | sed 's/ //g'`
fi
if [ "$QUALITY" -gt "$BestQuality" ]; then
BestQuality=$QUALITY
BestAP=$i
fi
fi
done
if [ $BestAP -gt 0 ]; then
# Yay, we found an unencrypted AP:
echo Connecting to...
ESSID=`cat $TEMP | grep ESSID | head -n$BestAP | tail -n1 | cut -d""" -f2`
echo ESSID=$ESSID
MODE=`cat $TEMP | grep Mode | head -n$BestAP | tail -n1 | cut -d":" -f2`
echo Mode=$MODE
CHANNEL=`cat $TEMP | grep Channel | head -n$BestAP | tail -n1 | cut -d"(" -f2 | sed 's/Channel //g' | sed 's/)//g'`
echo Channel=$CHANNEL
# Connect
iwconfig $interface essid $ESSID mode $MODE channel $CHANNEL
if [ -e /etc/dhcpc/dhcpcd-${interface}.pid ]; then
rm /etc/dhcpc/dhcpcd-${interface}.pid
fi
dhcpcd $interface
# Cleanup
fi
rm -f $TEMP $LOCK

Similar Messages

  • /etc/rc.d/network: bash script: how to find out, if there was an error

    hello!
    i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
    but there is a big problem: starting network success' every time, whether there was an error or not:
    $ /etc/rc.d/network start
    :: Starting network profile: 00wlan_home [BUSY]
    Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
    [FAIL]
    :: Starting Network [DONE]
    $ ls /var/run/daemons/
    ... network ...
    can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?
    thanks for your help, maybe we can improve the script. but i'm not a geek in bash!
    mfg iggy

    iggy wrote:
    hello!
    i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
    but there is a big problem: starting network success' every time, whether there was an error or not:
    $ /etc/rc.d/network start
    :: Starting network profile: 00wlan_home [BUSY]
    Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
    [FAIL]
    :: Starting Network [DONE]
    $ ls /var/run/daemons/
    ... network ...
    can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?
    thanks for your help, maybe we can improve the script. but i'm not a geek in bash!
    mfg iggy
    try using netcfg to start the wireless profile, that should keep you happy until the new network scripts are unleashed... which won't have this problem.
    James

  • How to send 2 variable value from bash script into java.class

    #!/bin/bash
      a=10
      b=20
       echo $a $b | java addition
    donehi there,
    currently i have a simple java coding ( a + b ). and i m trying to connect with bash script but this bash script coudln't Enter 2nd value (b=20) while i running for it. may i know how do i can Enter 2 value into it?
    output from terminal
    [seng@localhost java_class]$ bash addition.sh
    =======================================================================
    simulation 1
    Num_a       = 10
    Num_b       = 20
    Enter your Num_a : 10
    Enter your Num_b : Exception in thread "main" java.lang.NumberFormatException
       at java.lang.Integer.parseInt(java.lang.String, int, boolean) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Integer.parseInt(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at filter_god.GOD(java.util.List, java.util.List, java.lang.String, java.lang.String, int) (Unknown Source)
       at filter_god.main(java.lang.String[]) (Unknown Source)
       at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
       at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    =======================================================================

    That code will send both numbers on a single line in standard input to the java process. So if the process reads standard input, it will get a single line that has this in it: "10 20".
    I'm guessing you're sending that whole line to Integer.parseInt. But a valid number doesn't have a space in the middle.
    You should split up the line using String.split. Or use a StringTokenizer. Or a regular expression. Or you can use a java.util.Scanner. Or a java.io.StreamTokenizer. Or maybe some other stuff that has slipped my mind at the moment.

  • My first bash script - update mirrors and then update your system.

    Like the title says, this is my first attempt at a bash script.
    I wrote it to make it a tiny bit easier for my wife to keep her system up to date without needing to remember the terminal commands.  She runs it via an entry in her openbox menu.
    It calls on reflector to check all available mirrors for the most up to date and then use rankmirrors to find the fastest 5 and write them to /etc/pacmand.d/mirrorlist
    Finally, it syncs and upgrades via the command pacman -Syyu
    #!/bin/bash
    # runs reflector to optimize mirrors
    echo "I'm afraid I can't do that Dave"
    sudo reflector -l 5 -r -o /etc/pacman.d/mirrorlist
    echo " I hope you trust me..."
    echo " "
    sleep 2s
    # updates system
    sudo pacman -Syyu

    I've scavenged some code to take care of the root thing, but why rebase vs pacman?  After reading up on rebase a bit, I'm not quite sure how to use it to complete the upgrade once it's updated everything.

  • Bash script to sync KeepassX database

    I created a my first little bash script to sync my Keepass(X) (Keepass on Windows boxes and KeepassX on Linux boxes) over a secure (SSL + Login) webdav enabled site.
    #!/bin/bash
    host=https://www.some_dav_enabled_website.com/db.kdb
    user=foo
    pass=bar
    fpath=/somefolder/db.kdb
    function update {
    echo "Deleting old KeepassX database..."
    rm $fpath
    echo "Downloading new KeepassX database..."
    curl -sku $user:$pass $host -o $fpath
    echo "Starting KeepassX..."
    keepassx $fpath &
    function sync {
    echo "Uploading the KeepassX database to server..."
    curl -sku $user:$pass -X PUT -T $fpath $host &> /dev/null
    echo "Database updated!"
    while getopts "us" optname
    do
    case "$optname" in
    "u")
    update
    "s")
    sync
    echo "Usage: -u Update to the latest KeepassX database."
    echo " -s Sync the (un)modified KeepassX database."
    esac
    done
    Enjoy !
    Last edited by SiB (2008-07-31 23:58:59)

    Hi Sybrand Bakker,
    I tried streams for the replication purpose as per your suggesion, till Iam unable make it work , i dont find a step by step document which will make it possible without error.
    One more thing , i need the streams work without Database link, ie., source database is not connected directly to destination database. I need to create streams and transfer the stream as a file through FTP.I need to download stream file in remote location and then apply the streams to destination database and after this source and destination database should be same in data and schema.
    Please suggest me a solution to go abt this scenario. We are in critical stage to make it happen...
    thanking you in advance
    with regards
    vivek
    Message was edited by:
    Vivekanandh

  • I am U.S. iPhone 4S user traveling in China.  Data speed is too slow to be usable.  Verizon says that it because iPhone 4S connects to strongest signal even if slowest.  Any work arounds for this design flaw?

    I am U.S. iPhone 4S owner traveling in China.  Data speed is too slow to be usable.  Verizon says that is because iPhone 4S connects to strongest signal, even if slowest (virtually non-existent) data network.  Does anyone know how to work around this design flaw?

    I spent 2 months in china with my old iphone 3gs.  Both China Unicomm and China Mobile were accessible through my US phone.  (for you other users, yes my phone bill was sky high, but it's a small price to pay when you get instant access to your wife while you are gone... and to be able to use the google translate app).  I had a GSM phone (obviously) and had the ability to choose what carrier I wanted my phone to connect to (the same thing was available when I was in italy as well). 
    it was under
    general-> network> then there was a new field (that does not normally show up when in the US) that listed the available networks to connect to.  my phone always attempted china unicomm first, and switched to china mobile only when unicomm was unavailible. 
    but if wjosten is correct (and i imagine he is), cdma phones may not be able to choose what network to connect to. 

  • Help!  Safari / Firefox won't connect to internet on WiFi?!

    I can't connect to internet using WiFi from Safari OR Firefox from my home WiFi (Apple WiFi router.)
    Here are weird facts:
    - They both work from this laptop at home using Ethernet
    - They both worked at AppleStore WiFI today
    - Internet at home is fine from other MacBook, iPad and 2 iPhones
    AppleStore guy reset a lot of Safari and network settings, suggesting that would fix anything, but it still does not work from this laptop at home over WiFi?!
    Any ideas?!
    Thanks!
    Mark

    Thanks, Linc.  FYI, I don't believe I've installed any new 3rd pary items for some time (although some of them may have updated to newer versions more recently?)
    I've posted output from Terminal commands below.  Let me know what you see in it!
    FYI, I've been considering updating to Lion OS.  Would that a) help me with this situation, and/or b) cause me other new problems?!
    Thanks,
    Mark
    Last login: Wed Nov  2 16:42:20 on console
    markmb:~ Mark$ kextstat -kl | awk ' !/apple/ { print $6 $7 } '
    net.telestream.driver.IODVDImage(1.0.4
    com.parallels.kext.prl_netbridge(6.0
    com.parallels.kext.prl_vnic(6.0
    com.vara.driver.VaraAudio(1.0.1)
    com.parallels.kext.prl_usb_connect(6.0
    com.parallels.kext.prl_hypervisor(6.0
    com.parallels.kext.prl_hid_hook(6.0
    markmb:~ Mark$ sudo launchctl list | sed 1d | awk ' !/0x|apple|com\.vix|edu\.|org\./ { print $3 } '
    Password:
    com.parallels.vm.prl_naptd
    com.sierrawireless.SierraSWoCMon
    com.roamingclient.cell.mac.roamingclient
    com.parallels.desktop.launchdaemon
    com.micromat.TechToolProDaemon
    com.google.keystone.daemon
    markmb:~ Mark$ launchctl list | sed 1d | awk ' !/0x|apple|edu\.|org\./ { print $3 } '
    com.culturedcode.thingshelper
    com.parallels.vm.prl_pcproxy
    com.parallels.desktop.client.launch
    com.micromat.TechToolProAgent
    com.hp.messagecenter.launcher
    com.hp.devicemonitor
    com.google.keystone.root.agent
    ws.agile.1PasswordAgent
    com.adobe.ARM.925793fb327152fd34795896fa1fb9ffa268b2a852256fe56609efa3
    markmb:~ Mark$
    markmb:~ Mark$
    markmb:~ Mark$ ls -1A {,/}Library/{Ad,Compon,Ex,Fram,In,La,Mail/Bu,P*P,Priv,Qu,Scripti,Sta}* 2> /dev/null
    /Library/Components:
    /Library/Extensions:
    tun.kext
    /Library/Frameworks:
    .DS_Store
    Adobe AIR.framework
    DivX Toolkit.framework
    EWSMac.framework
    HPDeviceModel.framework
    HPPml.framework
    HPServicesInterface.framework
    HPSmartPrint.framework
    HPSmartX.framework
    MacFUSE.framework
    NyxAudioAnalysis.framework
    PluginManager.framework
    TSLicense.framework
    iPassCommon.framework
    /Library/Input Methods:
    /Library/InputManagers:
    1PasswdIM
    GearsEnabler
    ProfcastGaragebandPlugin
    /Library/Internet Plug-Ins:
    .DS_Store
    AdobePDFViewer.plugin
    DirectorShockwave.plugin
    Disabled Plug-Ins
    DivXBrowserPlugin.plugin
    Flash Player.plugin
    Flip4Mac WMV Plugin.plugin
    Flip4Mac WMV Plugin.webplugin
    Google Earth Web Plug-in.plugin
    JavaPlugin2_NPAPI.plugin
    JavaPluginCocoa.bundle
    NP-PPC-Dir-Shockwave
    OVSHelper.plugin
    OfficeLiveBrowserPlugin.plugin
    Photo Center Plugin.plugin
    Quartz Composer.webplugin
    QuickTime Plugin.plugin
    RealPlayer Plugin.plugin
    Silverlight.plugin
    flashplayer.xpt
    googletalkbrowserplugin.plugin
    iPhotoPhotocast.plugin
    npgtpo3dautoplugin.plugin
    nsIQTScriptablePlugin.xpt
    /Library/LaunchAgents:
    .DS_Store
    com.google.keystone.agent.plist
    com.hp.devicemonitor.plist
    com.hp.messagecenter.launcher.plist
    com.micromat.TechToolProAgent.plist
    com.parallels.desktop.launch.plist
    com.parallels.vm.prl_pcproxy.plist
    /Library/LaunchDaemons:
    com.apple.third_party_32b_kext_logger.plist
    com.google.keystone.daemon.plist
    com.micromat.TechToolProDaemon.plist
    com.parallels.desktop.launchdaemon.plist
    com.roamingclient.cell.mac.roamingclient.plist
    com.sierrawireless.SWoCMon.plist
    com.sierrawireless.SierraReset.plist
    /Library/PreferencePanes:
    DivX.prefPane
    Flash Player.prefPane
    Flip4Mac WMV.prefPane
    Growl.prefPane
    MacFUSE.prefPane
    NTFS-3G.prefPane
    Perian.prefPane
    TechTool Protection.prefPane
    iPassConnect.prefPane
    /Library/PrivilegedHelperTools:
    com.roamingclient.cell.mac.roamingclient
    /Library/QuickLook:
    GBQLGenerator.qlgenerator
    ParallelsQL.qlgenerator
    iWork.qlgenerator
    /Library/QuickTime:
    AC3MovieImport.component
    AppleIntermediateCodec.component
    AppleMPEG2Codec.component
    DivX Decoder.component
    DivX Encoder.component
    Flip4Mac WMV Advanced.component
    Flip4Mac WMV Export.component
    Flip4Mac WMV Import.component
    Google Camera Adapter 0.component
    Google Camera Adapter 1.component
    Perian.component
    /Library/StartupItems:
    HP IO
    HP Trap Monitor
    ParallelsTransporter
    Library/Address Book Plug-Ins:
    SkypeABDialer.bundle
    SkypeABSMS.bundle
    Library/InputManagers:
    Smart Crash Reports
    Library/Installer Logs:
    Library/Internet Plug-Ins:
    ClickToFlash.webplugin
    Rave.plugin
    Library/LaunchAgents:
    .DS_Store
    com.adobe.ARM.925793fb327152fd34795896fa1fb9ffa268b2a852256fe56609efa3.plist
    com.apple.FTMonitor.plist
    com.apple.SafariBookmarksSyncer.plist
    com.apple.apsd-ft.plist
    com.apple.imagent.plist
    com.apple.marcoagent.plist
    ws.agile.1PasswordAgent.plist
    Library/Mail/Bundles:
    Library/Mail/Bundles (Disabled):
    Library/PreferencePanes:
    Contents
    Library/ScriptingAdditions:
    .DS_Store
    1Password Addition.osax
    markmb:~ Mark$

  • Executing Bash scripts from Apex

    Hi,
    I have several bash scripts that I would like to execute via APEX (the parameters will be supplied through Text fields, and the "execute" button will execute the script.
    The script will be located in the local server (the server where the APEX is installed), and it will perform several activities - for instance, it will execute EMCLI commands (Grid control command line).
    How can one do it ?
    Regards,
    Roni.

    Hello,
    1. Can you please show me examples of HOW to connect between the existing Scheduled job (I've created a job via dbms_scheduler) and executing it in APEX ?
    2. In addition - I need to complicate things a little bit.
    My job executes a procedure that have arguments.
    The arguments are being generated from several field items that I'll create inside apex.
    (Each variable should be inserted to a dbms_scheduler.set_job_argument_value procedure).
    I'm having trouble to pass the variables - how do I set value to a variables, that I can use in Other pages ?
    Only when I set default values to the items, I could take the default value to other pages.
    I tried to reference them with the format :P2_var_name. (with the dot) or with &P2_var_name.
    Thanks,
    Roni.

  • [solved] Running a command in background (bash script)

    Salut,
    as netcfg2 does not work with my wireless connection, I have to set up the connection manually. For not having to type in the commands every time, I created a bash script.
    #!/bin/bash
    iwconfig wlan0 mode managed essid mynetwork channel 6
    ifconfig wlan0 up
    wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf -dddd &
    dhcpd wlan0
    This works fine till the wpa_supplicant line. wpa_supplicant is not started in the background (as I thought, the ampersand at the end of the line would.
    So how can I get wpa_supplicant run in the background?
    Thanks in advance,
    Stefan
    Last edited by vbtricks (2008-05-11 09:13:36)

    Ramses de Norre wrote:How do you know it isn't? What exactly does happen?
    The script does not return to the user-prompt. Is an ampersand at the end of the line the correct solution, or are you unsure yourself?
    bender02 wrote:On thing is that even if it starts, it does take it a couple of seconds to connect, so it's probably not very good to run dhcpcd right after wpa_supplicant. Another thing is that you probably have a typo up there, shouldn't it be 'dhcpcd' instead of 'dhcpd'?
    Well, as the wpa_supplication command is not really run in the background the script did never execute the dhcpcd command. After having solved the above, correcting the spell-mistake will be a smaller problem. Even calling the dhcpcd command myself would be no unworkable way, the open root-shell (as I have to use another as the one calling the script is blocked) is a far greater problem...

  • IPod 4th Gen will no longer connect to my home wifi, what can I do?

    This problem started recently, I would arrive home, take my iPod off airplane mode (and yes, wifi did turn on) but my iPod would just not connect to my home wifi. I went to wifi>choose a network and manually selected my network but when I did, it would say "Unable to joine the network 'network name'". This problem slowly got worse: when I would wake up in the mornings or after not using my iPod for a long period of time, the same issue would occur! Usually it would take at least an hour if i was lucky of consatant retrying before, miraculously, it would connect. That was, up until yesterday though, when it would just simply not connect and display the message. I have tried almost everything I could think of: forgetting the network, restarting the iPod, restarting the modem/router (its an all in one setup), and even resetting the iPod but it just won't work, so now i'm stuck with a wiped iPod that just won't connect. One last thing, all my other wireless devices (iPad, PS3, laptop) work just fine and my iPod can connect to other networks. Please help me as I use my iPod very frequently and can't even restore to iCloud back-up.

    Does the iOS device connect to other networks?
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • IPhone no longer connects to iTunes via Wifi

    On July 1,12 my iTunes did an automatic update.  After the computer restarting and I entered iTunes and the following messages appeared:
    Message 1: Must reinstall itunes to connect to ipod or mobile devices.
    Message 2: CD/DVD folder must be located in itunes folder in order to use with itunes
    I have 2 iphones (both 4s, bought at same time, both running iOS 5.1.1)and one will briefly connect to itunes via Wifi (I will identify this one as iphone1) but the other one will not (I will identify this one as iphone2).  I have a PC with Windows 7.
    When iphone1 is connected to itunes via wifi is disconnects randomly.  Under: Summary > Version, it has the message: Connect this iphone using a USB cable in order to update or restore its software.  When I have it connected with the USB cable, there are no problems. The settings selected under: Summary > Options > are: Open iTunes when this iphone is connected, Sync with this iphone over Wi-Fi,  & Manually manage music and videos.  The Setting under Backup > Back up to this computer (where it backs up to; I do not know)
    iphone2 does not connect via Wifi but used to.  It connects without issues with the USB. The Settings in iTunes > Summary are the same as iphone2 except that iphone2 is set as Backup > Back up to iCloud.
    My iphone2 is my primary device.  I use it exclusively; for music, taking photos, syncing photos to my Photo Stream folder on my PC, etc.  The iphone1 is my spouse's secondary phone, so its not used as often (ie: only has 4 songs downloaded, used to take the odd picture, has a mirror image of apps from iphone2).
    I searched Apple Support and tried the following solutions that didn't solve this problem:
    How to restart the Apple Mobile Device Service (AMDS) on Windows (support.apple.com/kb/TS1567) &
    Set the Apple Mobile Device Service Startup type to Automatic
    I have not done this: Remove and reinstall iTunes and AMDS. I did goto the: iTunes for Windows: Device Connectivity Tests > iOS > iPhone - iTunes Troubleshooting Assistantand into iTunes > Help > Run Diagnostics.  The results were: All tests passed. (My iphone2 was plugged in with USB. The iphone1 was connected via WiFi.)
    What do I do now?  Do I need to remove and reinstall iTunes? and if so will I lose all my itunes info (videos, music, apps, settings) or will it just show up after I install iTunes?

    Hi Mitch,
    It sounds like you have already done many of the steps, but I would like you to look at this article -
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    and go over any that you may have missed.
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • How do i let my iphone connect to my computer wifi with usb ?

    As the title stated,
    How do i let my iphone connect to my computer wifi with USB ?
    The reason is because my iPhone 3Gs wifi having some problem. So i have to use a USB cable to connect to my computer and let my iphone to connect to the internet .
    If i don't do this i would have to keep on running out & in to my room & my living room.
    My iPhone 3Gs allows to connect to the wifi when i am in my living room, but once i enter my room the wifi won't be able any more. So please help me out please people
    I'm not sure about why i can't connect to my Ad hoc even it's so near, but i can connect to my router if i am in living rooms.
    Regards,

    I believe the next time you sync your phone to itune via the cord, you will have to check the box that says sync via wifi and also enable that setting on your iphone.

  • Sending email using bash script

    Hello:
    I am working on writing a bash script to notify one or more users by email of certain events. Run from the Terminal command line, and having the script "echo" text of (what would be) a form letter with in-line variable expansion (i.e., ${VARIABLE}), all seems to work as anticipated. Eventually, I want cron to launch this shell script, and send an email to an "on-subnet" user (I have postfix enabled on my Mac, and there are multiple local user accounts).
    I found some stuff on the web about sending mail from bash scripts, and so I made a small little test script, that reads like this:
    #!/bin/bash
    VARIABLE[1]="The 12,345 quick brown foxes "
    VARIABLE[2]="jumped over the 67,890 lazy dogs."
    mail -s "a test email" jv << EOF
    This is a test:
    ${VARIABLE[1]}
    ${VARIABLE[2]}
    This is the last line of the test message.
    EOF
    echo "script completed"
    It worked... almost... It sent a local email to my postfix mail account that read like this:
    This is a test:
    The 12,345 quick brown foxes
    jumped over the 67,890 lazy dogs.
    This is the last line of the test message.
    EOF
    echo "script completed"
    So, I have two questions. First, the easy one (I hope):
    How do I delimit the end of the text, that I want to be the message body of the email, from portions of the script that follow said email text?
    Next question is a little more involved. You know how, in Mail.app, if you go to Mail Preferences>Accounts>Account Information, you can put multiple email addresses, comma-delimited, in the "Email Address" field? So, if a person entered "[email protected], [email protected], [email protected]" in this field, then, even though (s)he may be at home, and using their home ISP's mail server, (s)he could send an email apparently from either their home, work, or school email address. Of course, the mail headers clearly would show it came from and through their home machine and home ISP, but it would be displayed in the recipient's Mail client viewer as having come from one of [email protected], [email protected], or [email protected].
    I'd like to do something similar here, whereby the email (that is being sent to one or more local users' postfix account on my computer) would apparently be sent from "watchdog@localhost" rather than from "jv@localhost" like it seems to do by default. Whatever account the script is run from (or presumbably, whose cron tab is launching the script) is what the "From" address is set to.
    I'd rather not create an additional mail account, because I am using Mac OS X built-in accounts for the postfix mailboxes (I don't want to have to maintain a plaintext username:password file in postfix, and I don't want to create an additional user account on the computer).
    So, is there a way to specify an alternate "From" username when invoking the mail -s ${SUBJECT} ${RECIPIENT} command in a bash script? Or is there a different, alternate mail command that will let me do so? (please include a description of syntax and how I'd package the above message text for the alternate method).
    Thanks in advance, all!

    Hi j.v.,
    The > after EOF is just a typo (or may be added by the Discussion ?) and you must delete it; other > are prompts from the interactive shell. Andy's post shows an interactive use of shell, not a shell script (note the shell prompt % in front of the commands). A typical use of here document may look like
    command <<ENDOFDATA
    ENDOFDATA
    There must be no spaces before and after ENDOFDATA. The word ENDOFDATA can be EOF or any other string which is guaranteed not to appear in the text (the .... in the example above).
    You can modify the From: header by using sendmail command (postfix has it as a compatibility interface):
    /usr/sbin/sendmail -t <<EndOfMessage
    Subject: test mail
    To: jv
    From: watchdog
    This is a test:
    ${VARIABLE[1]}
    ${VARIABLE[2]}
    This is the last line of the test message.
    EndOfMessage
    There must be a blank line between the headers and the mail body.
    I assume that you send these mails only to users on your local Mac. Please do not send mails to remote users by using the sendmail command unless you know what you are doing completely.
    PowerMac G4   Mac OS X (10.4.5)  

  • My macbook pro cannot connect to internet via wifi

    I have a Macbook Pro 2010 OS X 10.8.3.  I cannot connect to internet via wifi (Air por).  My Macbook Pro does not recognize my network and when I select it from the list of network it asks for my network password.  when I type in my password a dialog box gives me timeout error.  Please could anyone help me.  I am using ethernet for my connection at the moment.  Do I need to reset my macbookpro?  if yes, what will happen to my applications and operating system (mountain lion)?
    Monireh

    When you use the Airport utility what happens?
    What is in the System Preferences control panel for Network settings?
    http://www.apple.com/support/airport - there is a forum just for Airport Community
    Airport Express FAQ
    http://support.apple.com/kb/HT1515
    Wi-Fi Setup Considerations
    Things to consider before you begin
    Start with a plan for the physical layout. Depending on whether you have an existing Wi-Fi network, or if you are using your AirPort Express as a standalone Wi-Fi device, there are several options available for you to choose from.
    When using Ethernet, Cat6 cable is recommended.
    The layout you choose should take into account environmental factors such as physical access, location, range, radio frequency interference, etc.
    You will need to consider what AirPort Utility settings to adopt.
    You will need to know whether you are using an AirPort Express (802.11b/g) or an AirPort Express (802.11a/b/g/n).
    If you will be using more than one Wi-Fi base station, it may be helpful to read the article Extending the range of your wireless network by adding additional Wi-Fi base stations.
    AirPort Discussions
    Discuss your AirPort Base Station, Time Capsule and Wi-Fi questions with fellow community members.
    More
    Direct you to the proper forum for MacBook :
    MacBook Series Forumshttps://discussions.apple.com/community/notebooks?view=discussions
    Mac OS X Forums
    https://discussions.apple.com/community/mac_os?view=discussions 
    http://www.apple.com/support/macbookpro

  • New Ipad mini will not connect automatically to home WiFi network

    I use a range of Apple devices at home, IPhone 4, MacBook Pro and IMAC.
    They all see and connect automatically to my WiFi home network. I never experienced any difficulty with my DLINK router.
    I have received a couple of days ago my new Ipad mini (Wifi+ cellullar), running IOS 602, but not equipped with a SIM card.
    The device never connects automatically to the home WiFi network.
    I need to open the Settings app, chose the WiFi submenu and select manually my "dlink" network. Then only can I work with my network.
    I need to perform this each time I leave my home or I restart the device.
    As I am experienced with Apple devices I noticed this behaviour right away and can confirm that the settings on the Ipad mini are the same as the ones of the IPhone 4. I am certain that this is a bug.
    Any suggestion to overcome this major frustration?
    Patrick

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

Maybe you are looking for

  • Submitting podcast results in "network connection has reset" error

    Hello, I've been attempting for the past few days to submit my podcast RSS feed to iTunes. Each time I try, it loads for about a minute before giving me an error message: "We could not complete your iTunes Store request. The network connection was re

  • "Navigator" via JSF in a Struts Application (struts-faces)

    Hi! I got an existing Struts application which uses some includes to display a "Menu" on the left side with several links to navigate through the Webapp. Each of the Links points to a Struts-Action, that does some business logic and redirects any of

  • Work on files across platform mac pc

    Hi, Is it possible and is there an easy to work on files in lightroom on a mac and then transfer the edited files to a pc into an existing LRE catalog? I have LRE on my pc but want to do some work for a short period of time on someone else's mac. I w

  • JSF with EJB

    Hi, I am new to JSF. I was wondering if anyone can shed some light on how to use JSF in J2ee environement? Will it be ActionListener's responsibility to update the model (communicate with EJB's)? Any help will be highly appreciated. Thanks, Paresh

  • How many contacts can i stored in iphone4s?because I lost old contacts when I add in new contact.

    How many contacts can i stored in iphone4s?because I lost old contacts when I add in new contact.