Join Today
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1

    Default ALF v0.1 - Automatic Link Fixer !

    Here my first scripts that should make an automatic PPP and internet connection, as soon as you get in range of your PC.
    The nexts version will also rsync your files automaticly.

    Read the comments in both files for more info.
    Attached Files Attached Files

  2. #2

    Default Re: ALF v0.1 - Automatic Link Fixer !

    cool, thanks for sharing!

    one simple way to handle the root requirement is to put the working code into a alf.sh script, then have the .lin script use start-stop-demon to start the alf.sh script, e.g. start-stop-daemon --start -c root -x /diska/alf.sh &

  3. #3

    Default Re: ALF v0.1 - Automatic Link Fixer !

    Cool

    Just one question - I noticed you kill the daemons on the phone when ppp goes down. Any reason why ?

    I usually leave them on. If the phone goes out of range and connection dies, and later connection is re-established, my sessions are still alive unless one of the hosts was trying to send something over the TCP connection for 30m or so. This way, if I go out of range for a few mins and come back, I don't have to remount my smbfs or restart my telnet sessions.

    (Actually, it happens quite often. I'm sitting at the keyboard, hacking the phone. Suddenly, I get a phone call. I answer and start walking around while talking. BT and PPP connections die and are re-established when I come back at the end of the call, but my telnet sessions are still alive so I don't lose my history).

  4. #4

    Default Re: ALF v0.1 - Automatic Link Fixer !

    rpconnect: i tried to make the script restart it's self if it's not root by useing start-stop-daemon. it didn't work somehow. the code is commented out, try to get it working please.

    mack: thats just a personal preference to save resources/battery and stuff.
    btw: when inetd is killed, existing telnet sessions won't be interrupted.

  5. #5

    Default Re: ALF v0.1 - Automatic Link Fixer !

    psy0rz: you're right re inetd, but smbd still gets the smbmount on the other side hung if you kill the phone's smbd. As for battery, I'm not sure it takes more battery when it doesn't do anything. On the other hand, doing something (such as the 'test -c') every 5 seconds may prevent the phone from going to sleep, and increase battery consumption. If you want to preserve your battery, maybe it would be best to strace the process that creates the pty (i.e. the process that keeps /dev/ptmx open), and strace it before the SPP connection is formed, to see how it gets informed. Most likely, it select(2)s on some named socket in /tmp and gets a message. If you find this message, you can write a small prog that waits on the same socket and looks for the same message. With this approach, your script will be blocked on select(2) or read(2) and scheduler will be able to put the system to sleep.

  6. #6

    Default Re: ALF v0.1 - Automatic Link Fixer !

    yes i'm aware of the polling problem. i just used this method for now to get the project started, hoping someone else figures out which pipe to select() on

    the smbd could be kept running indeed.
    however, perhaps it would be neater to let alfpc.sh do the automatic mounting and unmounting with appropriate parameters?

    the original idea was:
    -automatic link up: lots of stuff running
    -automatic link down: clean telephone

    maybe there should be some config variables in the script so people can choose what they want.

    the most imporant right now is to make this thingy robust and solve the polling problem.

  7. #7
    Join Date
    Mar 2005
    Posts
    2,341

    Default Re: ALF v0.1 - Automatic Link Fixer !

    how to start(execute) the alfpc.sh file on the computer?

    i just got this:

    linux:/home # ./alfpc.sh
    bash: ./alfpc.sh: Permission denied
    Motorola e680 (flashed to e680i) + 4Gb SD card + HT820 Stereo BT Hedphones,
    Ubuntu 6.10 + 7.04,
    Nokia N95 + 8Gb microSD

  8. #8

    Default Re: ALF v0.1 - Automatic Link Fixer !

    this is a developer release only, so it won't work on your pc

    you need to make scripts executable first:
    chmod +x ./alfpc.sh
    ./alfpc.sh

    however i expect you run into more problems since there isn't any documentation yet on what other projects are required to get this one running.

    goodluck

  9. #9
    Join Date
    Sep 2005
    Location
    Berlin, Germany
    Posts
    3

    Default Re: ALF v0.1 - Automatic Link Fixer !

    Like rpconnect already pointed out, the way to bcome root is as follows:

    if [ "`id -u`" -ne 0 ]; then
    # Start another instance as root
    start-stop-daemon -S -c root -x $0 &
    # This origin instance of the Script keeps running (not as root!)!
    # So wait a while an then exit
    sleep 15
    exit 0
    fi

    I didn't test ur script and couldn't see what you tried & commented out, but the next line after the user-check you kill all "other" instances of alf.lin (except the current) so surely the origin as well.
    This might be one reason why it didn't work.

    Dunno if putting it into background with & is enough to keep the second instance alive when the calling instance dies.

    Ulle

  10. #10
    Join Date
    Mar 2005
    Posts
    2,341

    Default Re: ALF v0.1 - Automatic Link Fixer !

    thanks, when i run the alfpc.sh i got this first for 15sec long:

    * No PPP connection, reconnecting...
    dund[11617]: Bluetooth DUN daemon version 2.15
    dund[11617]: Connecting to 00:14:9A:7D:A7:07 channel 5

    later

    dund[11623]: Connect to 00:14:9A:7D:A7:07 failed. Host is down(112)

    also my BT looking for this address
    00:14:9A:7D:A7:07
    Motorola e680 (flashed to e680i) + 4Gb SD card + HT820 Stereo BT Hedphones,
    Ubuntu 6.10 + 7.04,
    Nokia N95 + 8Gb microSD


 
+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Automatic Reply
    By manishmahabir in forum E6 General Chat
    Replies: 3
    Last Post: 09-11-2009, 01:36 PM
  2. Automatic wallpaper changer
    By kamesh in forum E6 General Chat
    Replies: 4
    Last Post: 07-18-2009, 01:50 PM
  3. Automatic Recording the call
    By iustadi in forum E6 General Chat
    Replies: 2
    Last Post: 12-17-2008, 10:44 AM
  4. automatic time
    By ajnolte18 in forum E6 General Chat
    Replies: 1
    Last Post: 10-27-2008, 08:30 PM
  5. Automatic Backup for E6
    By ashish89 in forum E6 General Chat
    Replies: 2
    Last Post: 10-19-2008, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1