From owner-freebsd-hackers Tue Jul 25 15:42:59 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id PAA16061 for hackers-outgoing; Tue, 25 Jul 1995 15:42:59 -0700 Received: from tcsi.tcs.com (tcsi.tcs.com [137.134.41.11]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id PAA16055 for ; Tue, 25 Jul 1995 15:42:58 -0700 Received: from laguna.tcs.com (laguna-le0.tcs.com [137.134.101.17]) by tcsi.tcs.com (8.6.10/8.6.10) with ESMTP id PAA11143 for ; Tue, 25 Jul 1995 15:42:27 -0700 Received: from cozumel.tcs.com (cozumel.tcs.com [137.134.104.12]) by laguna.tcs.com (8.6.11/8.6.10) with SMTP id PAA02955 for ; Tue, 25 Jul 1995 15:42:24 -0700 Received: by cozumel.tcs.com (5.x/SMI-SVR4) id AA02416; Tue, 25 Jul 1995 15:41:22 -0700 From: ambrisko@tcs.com (Douglas Ambrisko) Message-Id: <9507252241.AA02416@cozumel.tcs.com> Subject: Shell commands for iij config scripts To: hackers@freefall.cdrom.com Date: Tue, 25 Jul 1995 15:41:21 -0700 (PDT) In-Reply-To: <199507251230.FAA23459@freefall.cdrom.com> from "owner-hackers-digest@freefall.cdrom.com" at Jul 25, 95 05:30:17 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: hackers-owner@FreeBSD.org Precedence: bulk Here is a couple of hacks I made to iij-ppp, I'd like these capabilities added. to main.c so that is would start ppp negotiation in auto mode. This is so it will work with slirp, it also still works with my straight ppp provider that isn't in my local call whereas my slirp connection is! *** main.c.orig Tue Jul 25 15:00:09 1995 --- main.c Tue Jul 25 15:00:44 1995 *************** *** 378,384 **** CcpInit(); LcpUp(); ! if (mode & (MODE_DIRECT|MODE_DEDICATED)) LcpOpen(OPEN_ACTIVE); else LcpOpen(VarOpenMode); --- 378,384 ---- CcpInit(); LcpUp(); ! if (mode & (MODE_DIRECT|MODE_DEDICATED|MODE_AUTO)) LcpOpen(OPEN_ACTIVE); else LcpOpen(VarOpenMode); to command.c so I can run a script from the config file when the link comes up (like dequeue any mail waiting on my system or at my providers site for me and update my named config file since slirp's DNS server keeps changing depending on the machine I get connected to) *** command.c.orig Tue Jul 25 14:55:00 1995 --- command.c Tue Jul 25 14:57:27 1995 *************** *** 168,173 **** --- 168,175 ---- "Save settings", StrNull}, { "set", "setup", SetCommand, LOCAL_AUTH, "Set parameters", "var value"}, + { "shell", NULL, ShellCommand, LOCAL_AUTH, + "Set parameters", "var value"}, { "show", NULL, ShowCommand, LOCAL_AUTH, "Show status and statictics", "var"}, { "term", NULL, TerminalCommand,LOCAL_AUTH, *************** *** 785,790 **** --- 787,812 ---- return(val); } + static int + ShellCommand(list, argc, argv) + struct cmdtab *list; + int argc; + char **argv; + { + int val = 1; + int count = 0; + char command[8192] /* this is bad */; + + if (argc > 0){ + for(command[0]=0;count''.\n"); + return(val); + } static int AddCommand(list, argc, argv) The reason why I did this, is that my phone bill was to expensive, my ppp connection was not in my local calling area and I had a shell account that was. So I run two iij-ppp auto sessions, a generic one that uses my shell account with slirp for general net surfing and the ppp-account to dequeue smtp mail waiting for my machine. Now I just have a ping in my crontab and that automatically dequeues my mail waiting for me once a day and my phone bill is a lot lower. Doug A.