Disconnect PPPoE via applescript?

Hi,
I've a Wireless router running on bridged mode connected to my Macbook through airport. I've created a PPPoE dialer to connect/disconnect.
Is there any way I could connect/disconnect it via applescript? I want to schedule reboot (reconnect) at 12am and disconnect at 7am. I used telnet for my previous router, but this one has some unknown firmware.
I'd appreciate any help on this. Many thanks.

Hello
Firstly I have to say I can only guess, for I don't use OSX10.5 for myself.
I found a seemingly relevant page here:
http://blog.heatery.com/2008/06/how-to-connect-or-disconnect-pptp-vpn.html
It contains sample codes to connect and disconnect PPTP VPN session by using application "System Events" under OSX10.5, which I think you can adapt for your need.
E.g.
--connect PPPoE
(* Code from AppleScript 2.0 Release Notes* )
tell application "System Events"
tell network preferences
tell current location
set aPPPoEService to a reference to (first service whose kind is 10)
if exists aPPPoEService then connect aPPPoEService
end tell
end tell
end tell
--disconnect PPPoE
(* A mixture of code from AppleScript 2.0 Release Notes and code from above link *)
tell application "System Events"
tell network preferences
tell current location
set aPPPoEService to a reference to (first service whose kind is 10)
if exists aPPPoEService then
set isConnected to connected of current configuration of aPPPoEService
if isConnected then disconnect aPPPoEService
end if
end tell
end tell
end tell
If you wish, I guess you may replace this line:
set aPPPoEService to a reference to (first service whose kind is 10)
with something like this line, which lets you refer to service by its name:
set aPPPoEService to service "your PPPoE service name"
Hope this may help,
H

Similar Messages

  • How can i connect/disconnect PPPoe via Ethernet connected time capsule??

    I connected the time capsule with Ethernet.
    I set connect to PPPoe with "Manual" option.
    I could easily control "Connect/disconnect" pppoe using AIRPORT (in the menu bar). But I could not find a way to "Connect/disconnect" via ETHERNET. (No ETHERNET icon on menu bar anyway...)
    Could somebody help? THanks a lot.

    Have you consulted the printer's user manual for setting it up as an Ethernet printer? You will also need to delete your current printer in Print & Fax and when you Add the printer you will need to do so as an Ethernet printer. This means you will add it either as an IP printer using either LPR or IPP protocol - depends on what the printer supports. An Ethernet device requires an IP address that is either manually configured on the device or derived if the device supports DHCP. If the former then the IP address you configure for the printer must be within the range of IP addresses used by your router (typically 10.0.1.2-10.0.1.199 for an AEBS/TC.) This should be covered in the printer's user manual.

  • How do you "save as" in Acrobat 9 via Applescript?

    Greetings all,
    I'm using the Applescript Script Editor and trying to do a "save as." The Applescript dictionary for Acrobat 9 has a reference to "save" in the Core Suite, but no matter what I try, I get an AS error that typically contains the text "document 1 does not understand the save message."
    I can do a "save as" via Applescripting that GUI but that seems problematic as well (I've set the Properties > Initial View options for document 1 after inserting a page--all via Applescript--but doing a "save as" via the GUI apparently does not save those properties. I would hate to have to script the process of having Acrobat open the file again and reset the initial view; I should be able to do that before saving the new file.
    Thanks,
    Kevin

    Hold down the OPTION key. The Save As option should appear in the File menu.

  • How to expand the folder via applescript?

    Dear apple experts,
    How to expand the folder via applescript?
    Manually we are using command + option + right arrow, but how we handle this in applescript?
    Thanks in advance,
    Velladurai.G

    Hello
    Finder's container's "expanded" and "completely expanded" properties have long been marked "NOT AVAILABLE YET" under OSX:
    Finder.sdef > Containers and Folders suite
    container n [inh. item] : An item that contains other items
        elements
            contains items, containers, folders, files, alias files, application files, document files, internet location files, clippings, packages.
        properties
            entire contents (specifier, r/o) : the entire contents of the container, including the contents of its children
            expandable (boolean, r/o) : (NOT AVAILABLE YET) Is the container capable of being expanded as an outline?
            expanded (boolean) : (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists)
            completely expanded (boolean) : (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists)
            container window (specifier, r/o) : the container window for this folder
    A way to expand a given folder is to use keystroke command of System Events to invoke the keyboard shortcut in Finder. Something like the following script.
      kLeftArrowCharCode            = 28,
      kRightArrowCharCode           = 29,
      kUpArrowCharCode              = 30,
      kDownArrowCharCode            = 31,
    --set f to (path to downloads folder from user domain) -- target folder e.g.
    set f to (choose folder)
    tell application "Finder"
        reveal f
        tell Finder window 1
            set cv to current view
            if cv = column view then return -- do nothing
            if cv = icon view then set current view to list view
        end tell
        my _keystroke(it, character id 29, {option down, command down}, 0.2)
    end tell
    on _keystroke(_app, _key, _modifiers, _delay)
            reference _app : application reference
            string _key : character(s) to be keystroked [1]
            list _modifiers : list of modifier key to be pressed; enumerations are
                    command down
                    option down
                    shift down
                    control down
            number _delay : post-delay amount [sec]
            [1] Character must be present on the current keyboard layout. Otherwise, it is replaced by 'a'.
        tell _app to activate
        tell application "System Events"
            tell (process 1 whose bundle identifier = (_app's id))
                keystroke _key using _modifiers
            end tell
        end tell
        if _delay > 0 then delay _delay
    end _keystroke
    Regards,
    H

  • Server Push Notification via Applescript

    I am running a Mac Mini Server 10.9.
    I know that I can display a system notification by via AppleScript by doing:
    display notification "Lorem ipsum dolor sit amet" with title "Title"
    However; I would like to push a custom notification down to my iCloud enabled devices using Apple's Notification Protocol, bundled with server.
    For example purposes- My server is on a public IP address, which is dynamic. If it changes, I have a bash script setup to send me an email with the new IP address. I was hoping to utilize Apple's Notification tools to provide a more elegant solution for accomplishing these type of notifications.
    Thanks in advance for any insight.

    Dimiter Dimitrov
    For push notification, you have to use security profile as "Notification" and have to add required role as "Notification User". You can also add other authentication providers as you mentioned for MYSAPSSO2.
    Settings>Security profiles>Notification(Cannot be deleted)
    For APNs traffic to get past your firewall, you'll need to open these ports:
    TCP port 5223 (used by devices to communicate to the APNs servers)
    TCP port 2195 (used to send notifications to the APNs)
    TCP port 2196 (used by the APNs feedback service)
    TCP Port 443 (used as a fallback on Wi-fi only, when devices are unable to communicate to APNs on port 5223)
    Send Push Notifications to the Device
    Enabling Apple Push Notifications (APNS)
    Regards,
    JK

  • How to auto log in via applescript?

    I have no idea how to do it? do I need to curl, change html and post? but how do i post then? or how can i fill in password and log in on the safari page via applescript GUI scripting and press enter? I am just so confused right now:(

    I have no idea how to do it? do I need to curl, change html and post? but how do i post then? or how can i fill in password and log in on the safari page via applescript GUI scripting and press enter? I am just so confused right now:(

  • Select table to copy as image via Applescript

    hi,
    Very often I end up copying my tables and then startup Preview and do "New from Clipboard". Has anybody found a way to automate this via Applescript?
    There's no starting code by me as I haven't been able to find the command for select table.
    Thanks for any reply,
    Gert

    hi,
    Very often I end up copying my tables and then startup Preview and do "New from Clipboard". Has anybody found a way to automate this via Applescript?
    There's no starting code by me as I haven't been able to find the command for select table.
    Thanks for any reply,
    Gert

  • Turn off bluetooth via applescript when power is disconnected

    Hello all
    I've been fallowing this older thread here:
    http://discussions.apple.com/thread.jspa?messageID=2109999
    I've followed the instructions of the post,but when I run the script I get this
    error:
    Usage: grep [OPTION]... PATTERN [FILE]...
    Try `grep --help' for more information.
    sh: line 1: Applications: command not found
    Does anyone know if there is an updated version of this type of script or
    if this can be corrected?
    Thanks

    Hello
    I'm afraid that the code by Michael Henley in the referred thread has been altered by the fora software introduced in 2007. Perhaps the ac_power() handler should be read as -
    to ac_power()
    (do shell script "pmset -g | grep \\*") starts with "AC Power"
    end ac_power
    Good luck,
    H
    PS. Please copy code from this web page, not from subscribed email text, for I escaped some character for posting; namely \.

  • Sending an email via AppleScript and Dialogue Boxes

    I am trying to write a script to send an email via Mail of which the body of the message is from a dialogue box. I decided upon using Automator and AppleScript. I have, so far, the following workflow:
    1. Run Apple Script:
    set mypass to text returned of (display dialog "What are you doing?" with icon 1 buttons {"Tweet", "Cancel"} default button "Tweet" default answer "")
    2. New Mail Message.
    3. Send Outgoing Messages.
    4. Run Apple Script:
    on run {input, parameters}
    tell application "System Events" to set visible of process "Mail" to false
    return input
    end run
    I wand this workflow to allow the user to input an answer and this answer to be in the message field of the email. I can use the "Ask for Text" action in Automator but it does not allow for any control over the appearance of the dialogue box. The first script returns the result "<whatever is typed>" (ie. "Test") in the Results field below the script box, as does the "Ask for Text" action but it does not insert it into the message. Does anyone know what is going wrong here?
    I am relatively new to AppleScript which is why I am using Automator but would like any information on how this could be done entirely in AppleScript. My previous attempts at sending email using script was unsuccessful.
    My aim is to save this as an Application with a proper icon.

    see my reply to your post in the snow leopard forum.
    http://discussions.apple.com/thread.jspa?messageID=10318297&#10318297

  • Script to export a script as run-only via AppleScript Editor

    Hi,
    I have written a script that's creating a new script and than save it to the desktop as run-only.
    Now Apple has re-written the rules of AppleScript Editor so the run-only command had to go via 'Export' (and not 'Save' anymore).
    I can't figure out how to script it now... I even tried to script the menu's but that's only possible for all menu's without '...' ending it. For example: 'File > New' is scriptable, but 'File > Export...' is not.
    Script 1 is the script I want to get working, but if scripting the Export of AppleScript Editor is not possible, I want to get de workaround of Script 2
    Script 1:
    ==================================================
    set myScript to "
    set studentnumber to \"" & studentnumber & "\"
    set password to \"" & password & "\"
    tell application \"Safari\"
    tell application "AppleScript Editor"
    activate
    make new document with data myScript
              save document 1 as "application" in file ((path to desktop as Unicode text) & "Automatisch Inloggen op GLR.app") with run only
    -- save doesn't work anymore and has to be EXPORT...
              return
    close document 1
    end tell
    =================================================
    Script 2 (workaround, but doesn't work either)
    tell application "AppleScript Editor" to activate
    menu_click({"AppleScript Editor", "File", "Export..."})
    -- 'File > New' works but 'File > Export... not'
    on menu_click(mList)
              local appName, topMenu, r
    -- Validate our input
              if mList's length < 3 then error "Menu list is not long enough"
    -- Set these variables for clarity and brevity later on
              set {appName, topMenu} to (items 1 through 2 of mList)
              set r to (items 3 through (mList's length) of mList)
    -- This overly-long line calls the menu_recurse function with
    -- two arguments: r, and a reference to the top-level menu
              tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
                        (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
    end menu_click
    on menu_click_recurse(mList, parentObject)
              local f, r
    -- `f` = first item, `r` = rest of items
              set f to item 1 of mList
              if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
    -- either actually click the menu item, or recurse again
              tell application "System Events"
                        if mList's length is 1 then
      click parentObject's menu item f
                        else
                                  my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
                        end if
              end tell
    end menu_click_recurse

    Applescript has changed a little. You can now save uncompiled scripts, but it would make no sense to save an uncompiled script as read-only, so trying to do that fails. Add a compile command before the save:
    tell application "AppleScript Editor"
      activate
              set doc to make new document with data myScript
      compile doc
              save doc as "application" in ((POSIX path of (path to desktop)) & "Automatisch Inloggen op GLR.app") with run only
              return
      close doc
    end tell

  • How do I print duplex via AppleScript?

    Hello - I am new to applescript and having a bit of difficulty trying to get started. My initial goal is fairly straightforward: each day (via an iCal action) download a specific URL and print it. Specifically, it's my daily newspaper and I'd like it waiting on the printer in the morning.
    Most things worked very well via Automator, but I can't specify print options going that route (at least as far as I know). So, it my first good reason to learn AppleScript. However, I've perused quite a few sites and searched this forum, but can't figure out how to specify printer options like two sided printing.
    Can anyone please point me in the right direction.
    Not sure if you need this, but the printer type is a canon ip4300

    When you say "Adobe", do you mean Acrobat or Reader (for PDFs), or one of Adobe's many other programs?
    Usually, the option to print duplex is part of the print driver, and should appear in the print dialog regardless of the application.
    Some apps have their own front to the print dialog, but you should still be able to get the rest of it.
    The orientation is usually controlled by specifying Long Edge or Short Edge.

  • Hide Toolbar via Applescript?

    Is it possible to use an applescript to automatically hide the toolbar in new Finder windows?

    There aren't plists for every single folder (so it's impossible to 'write every value to false').
    The Finder 'metadata' (in this case I mean window location, view style, size, toolbar state etc) is stored in the hidden .DS_Store files, there should be one inside every folder with custom settings.
    There are scripts out there to remove them all, but I think it's risky, I think Finder comments are also stored in these files.
    Terminal can find the .DS_Store files via the find command (this searches home a.k.a '~')…
    find ~ -name .DS_Store
    I don't know of ways to edit these, so the usual solution is to delete them! Search around here for other ideas, ripping them out isn't the best idea. Sometimes permissions can prevent changes from sticking - repair disk permissions & user account permissions to set these to default values…
    Backup before you begin just in case.
    Boot holding cmd+R. Recovery mode should startup (assuming you have a recovery partition).
    Select Terminal from the Utilities menu.
    Enter the word…
    resetpassword
    … & hit return.
    The GUI app will open, select the main boot HD.
    Select your user account in the popup menu.
    Then click the Reset button at the bottom right. It will "Reset Home Folder Permissions & ACL's"
    Repeat for the other users.
    Quit ResetPassword from the menu,
    Quit Terminal
    You can also select Disk Utility and repair the system permissions & repair any disk damage that is reported via 'verify disk'.

  • Hot Corner as Droplet via AppleScript?

    Hi there,
    Could it be technically possible to make hot corner run as a droplet? It's feasible to open applications, files, scripts etc from hot corners by using programs like cornerclick, butler etc but none of them has any support for drag and drop. Has AppleScript means to do that? For example this would be by far the fastest way to tag and copy an image(via automator workflow) from Safari, Finder etc by requiring almost no precision compared to bringing up hidden dock and aiming for specific icon(droplet).
    Thanks,
    Üllar

    Till now I was using download folder to drop images and folder action was monitoring for any new files then to be opened with tagging application as HD suggested. The problem was that this method was not instantaneous and sometimes could skip quite a many images when they were added too fast. Save Image to "Downloads" would be even better solution compared to dragging, but somehow it skips the Where from: address info and I had to create an Automator workflow which inserts source URL from Safari into file spotlight comments, but also this folder action was sometimes very slow to react and the page in Safari was closed.
    iPhoto is too heavy/slow program which I would avoid from my workflow. I was looking into it only to see how it is getting around the sandboxing, but I guess it's only due to being Apple's own product so no avail.
    I have managed to find a workaround but it's ridiculously complex though quite fast. It uses six! different applications so it's far from straightforward. First the BetterTouchTool translates double triple tap on an image into keyboard shortcut which is picked up by QuicKeys which simulates drag and returns the cursor to original location, it needs 0.3s delay before release so it's almost instantaneous. Of course if the droplet is in the dock, its position is not static and in full screen mode, the dock is also hidden which could complicate things further(that's why I was asking for HotCorner droplet). So DragThing came to help. It's meant for additional docks, docklets etc. I just created one icon dock(only appearing when Safari is frontmost) in the corner and it's smart enough to also read image files dragged from Safari. After the drop it runs Automator workflow which copies dragged file to Download folder and opens it in TagIt, which I use for tagging. Up pops a little window and with few keystrokes it suggests already used tags so I can just press enter/space. After that Hazel will check for openmeta tags(unfortunately not availabel in Automator workflows) and moves them to designated folder. All this takes little more than a second of user intervention, most of it to insert tags.
    Advantage of using tags to folders is of course the ability to have many different criteria for one single file, which makes looking for a specific file a breeze in spotlight when the collection reaches to a size of a database.
    I hope somebody can find something useful from this workflow. Thanks again for the feedback.

  • RV042 PPPoA via bridged thompson 595v7

    Hi,
    I  have recently purchased the rv042, I have two broadband connections  both PPPoA, the first has a static IP and connects with the rv042 no  problem (via a Thompson 585v7 in bridge mode).
    The  second has a dynamic IP. I have set the Thompson 585 'modem' in to  bridge mode and when I connect via Ethernet to a PC, the PC is given an  external IP...ie bridge mode working correctly.
    In  the rv042 I set the WAN2 connection type as PPPoE, however the rv043  requires a username and password and my ISP does not use one.
    When  I click save setting on the rv042 the display is updated with some  characters in the password field, even though I left them blank.
    I have followed the full procedure from this article:
    http://www.cisco.com/en/US/products/ps9923/products_qanda_item09186a0080a369fb.shtml
    expect entering the username and password as there isn't one.
    My ISP's settings can be seen here:
    http://www.beusergroup.co.uk/technotes/index.php?title=Settings_for_other_routers
    RV042 firmware version: 1.3.13.02-tm
    Thompson routers both have latest firmware.
    Any support with this issue would be greatly appreciated.

  • ASA 5505 PPPoE via DSL

    Having trouble getting a public IP on the outside interface.
    ASA 5505 running 8.0(2)
    Westell E90610030-06 DSL box running current firmware.
    Service provider is AT&T (Bellsouth)
    DSL modem is in bridge mode.
    Outside interface of 5505 is set to PPPoE with known good credentials.
    I've tried CHAP and PAP authentication.
    Last attempt, using MAC cloning, showed a PPPoE address of 0.0.0.0 255.255.255.255 in the client monitor in ASDM. Authentication is still set to CHAP.
    I've read that AT&T does a 2-hour IP lease, so my next step is to shut down the DSL router for 2 hours and try again.
    I believe PPPoE debug is still broken in this ASA version, unfortunately.
    TIA

    interface Ethernet0/0
    nameif Outside
    security-level 0
    pppoe client vpdn group
    ip address pppoe setroute
    <--->
    vpdn group request dialout pppoe
    vpdn group localname
    vpdn group ppp authentication chap
    vpdn username password ******** store-local

Maybe you are looking for

  • Problem with secure video chat

    Hi there, I am having problems creating a secure video chat connection between my wife and my accounts. We both have .Mac accounts and are able to run encrypted text and audio chats, but when either of us try and establish a video connection with the

  • Bluetooth head set not detecting

    Hi..I have bought new C2-03 dualSIM handset which has not been detecting nokia BH 101 Bluetooth head set. was using same head set with sony ericsson handset, Does nokia this mode support this. Rgds

  • Darkening display when multiple displays hooked up

    I work at a church and we recently changed the cable we use to run video to our projectors.  It works great, but when we plug in the USB-to-DVI for our stage display the projectors get much darker.  What could be causing this and how do I fix it? The

  • I now have hundreds of duplicated bookmarks.  How do I remove them?

    I now have hundreds of duplicated bookmarks.  How do I remove them?

  • Should i upgrade Adobe flash every time?

    i just want to ask Adobe flash every time upgradation is necessary,i feel troublesome for this. can i upgrade to the highest version one time? not every time upgradation.