7 .Nd PPP control program
13 .Xo Oo Ar host : Oc Ns
14 .Ar Port | LocalSocket
18 .Ar command Oo ; Ar command Oc Ar ...
22 This utility provides command line control of the
25 Its primary use is to facilitate simple scripts that
26 control a running daemon.
30 utility is passed at least one argument, specifying the socket on which
38 If the socket contains a leading '/', it
42 If it contains a colon, it is treated as a
44 pair, otherwise it is treated as a TCP port specification on the
45 local machine (127.0.0.1).
50 may be specified numerically if you wish to avoid a DNS lookup
51 or do not have an entry for the given port in
54 All remaining arguments are concatenated to form the
56 that will be sent to the
59 If any semi-colon characters are found, they are treated as
61 delimiters, allowing more than one
66 .Bd -literal -offset indent
67 pppctl 3000 set timeout 300\\; show timeout
70 Do not forget to escape or quote the ';' as it is a special character
77 enters interactive mode, where commands are read from standard input.
78 When reading commands, the
80 library is used, allowing command-line editing (with
82 defining editing behaviour).
87 The following command line options are available:
90 Display all data sent to and received from the
95 displays only non-prompt lines received.
96 This option is ignored in
101 instead of the default 2 seconds when connecting.
103 if you wish to control a daemon over a slow (or even a dialup) link.
105 Specify the password required by the
108 If this switch is not used,
110 will prompt for a password once it has successfully connected to
114 The following environment variables are understood by
116 when in interactive mode:
117 .Bl -tag -width XXXXXXXXXX
119 The number of history lines.
123 Only values of "emacs" and "vi" are accepted.
125 are silently ignored.
126 This environment variable will override the
140 can be used to automate many frequent tasks (you can actually control
142 in any mode except interactive mode).
145 option is discouraged (even in scripts that are not readable by others)
148 listing may reveal your secret.
150 The best way to allow easy, secure
152 access is to create a local server socket in
153 .Pa /etc/ppp/ppp.conf
154 (in the correct section) like this:
155 .Bd -literal -offset indent
156 set server /var/run/internet "" 0177
161 to create a local domain socket, with srw------- permissions and no
162 password, allowing access only to the user that invoked
166 man page for further details.
168 You can now create some easy-access scripts.
169 To connect to the internet:
170 .Bd -literal -offset indent
172 test $# -eq 0 && time=300 || time=$1
173 exec pppctl /var/run/internet set timeout $time\\; dial
177 .Bd -literal -offset indent
179 exec pppctl /var/run/internet set timeout 300\\; close
182 To check if the line is up:
183 .Bd -literal -offset indent
185 pppctl -p '' -v /var/run/internet quit | grep ^PPP >/dev/null
186 if [ $? -eq 0 ]; then
193 You can even make a generic script:
194 .Bd -literal -offset indent
196 exec pppctl /var/run/internet "$@"
201 to control when dial-on-demand works.
204 to run all the time, but you want to prevent dial-out between 8pm and 8am
206 However, any connections active at 8pm should continue to remain
207 active until they are closed or naturally time out.
211 entry for 8pm which runs
212 .Bd -literal -offset indent
213 pppctl /var/run/internet set filter dial 0 deny 0 0
216 will block all further dial requests, and the corresponding 8am entry
217 .Bd -literal -offset indent
218 pppctl /var/run/internet set filter dial -1
221 will allow them again.
231 utility first appeared in