6 .Nd PPP control program
12 .Xo Oo Ar host : Oc Ns
13 .Ar Port | LocalSocket
17 .Ar command Oo ; Ar command Oc Ar ...
21 This utility provides command line control of the
24 Its primary use is to facilitate simple scripts that
25 control a running daemon.
29 utility is passed at least one argument, specifying the socket on which
37 If the socket contains a leading '/', it
41 If it contains a colon, it is treated as a
43 pair, otherwise it is treated as a TCP port specification on the
44 local machine (127.0.0.1).
49 may be specified numerically if you wish to avoid a DNS lookup
50 or do not have an entry for the given port in
53 All remaining arguments are concatenated to form the
55 that will be sent to the
58 If any semi-colon characters are found, they are treated as
60 delimiters, allowing more than one
65 .Bd -literal -offset indent
66 pppctl 3000 set timeout 300\\; show timeout
69 Do not forget to escape or quote the ';' as it is a special character
76 enters interactive mode, where commands are read from standard input.
77 When reading commands, the
79 library is used, allowing command-line editing (with
81 defining editing behaviour).
86 The following command line options are available:
89 Display all data sent to and received from the
94 displays only non-prompt lines received.
95 This option is ignored in
100 instead of the default 2 seconds when connecting.
102 if you wish to control a daemon over a slow (or even a dialup) link.
104 Specify the password required by the
107 If this switch is not used,
109 will prompt for a password once it has successfully connected to
113 The following environment variables are understood by
115 when in interactive mode:
116 .Bl -tag -width XXXXXXXXXX
118 The number of history lines.
122 Only values of "emacs" and "vi" are accepted.
124 are silently ignored.
125 This environment variable will override the
139 can be used to automate many frequent tasks (you can actually control
141 in any mode except interactive mode).
144 option is discouraged (even in scripts that are not readable by others)
147 listing may reveal your secret.
149 The best way to allow easy, secure
151 access is to create a local server socket in
152 .Pa /etc/ppp/ppp.conf
153 (in the correct section) like this:
154 .Bd -literal -offset indent
155 set server /var/run/internet "" 0177
160 to create a local domain socket, with srw------- permissions and no
161 password, allowing access only to the user that invoked
165 man page for further details.
167 You can now create some easy-access scripts.
168 To connect to the internet:
169 .Bd -literal -offset indent
171 test $# -eq 0 && time=300 || time=$1
172 exec pppctl /var/run/internet set timeout $time\\; dial
176 .Bd -literal -offset indent
178 exec pppctl /var/run/internet set timeout 300\\; close
181 To check if the line is up:
182 .Bd -literal -offset indent
184 pppctl -p '' -v /var/run/internet quit | grep ^PPP >/dev/null
185 if [ $? -eq 0 ]; then
192 You can even make a generic script:
193 .Bd -literal -offset indent
195 exec pppctl /var/run/internet "$@"
200 to control when dial-on-demand works.
203 to run all the time, but you want to prevent dial-out between 8pm and 8am
205 However, any connections active at 8pm should continue to remain
206 active until they are closed or naturally time out.
210 entry for 8pm which runs
211 .Bd -literal -offset indent
212 pppctl /var/run/internet set filter dial 0 deny 0 0
215 will block all further dial requests, and the corresponding 8am entry
216 .Bd -literal -offset indent
217 pppctl /var/run/internet set filter dial -1
220 will allow them again.
230 utility first appeared in