script
char **script;
if ((script = read_chat(&scrstr)) != NULL) {
while (r == 0 && script[i] != NULL)
if ((r = chat_expect(script[i++])) == 0 && script[i] != NULL)
r = chat_send(script[i++]);
free(script);
struct includeline *script, *se, *sp;
script = se = NULL;
if (script == NULL) {
script = sp;
for (sp = script; sp != NULL; sp = sp->next) {
while(script != NULL) {
se = script;
script = script->next;
struct script *script;
#define NCB_SCRIPT_PHYS(np,lbl) (np->p_script + offsetof (struct script, lbl))
static void ncr_script_fill (struct script * scr, struct scripth *scrh);
#define PADDR(label) (RELOC_LABEL | offsetof(struct script, label))
static struct script script0 = {
ncr_script_fill (struct script * scr, struct scripth * scrh)
READSCRIPT_OFF(np->script, offsetof(struct script, r))
WRITESCRIPT_OFF(np->script, offsetof(struct script, r), val)
if ((np->features & FE_RAM) && sizeof(struct script) <= 4096) {
np->script = NULL;
} else if (sizeof (struct script) > PAGE_SIZE) {
np->script = (struct script*) kmem_alloc_contig
(round_page(sizeof (struct script)),
np->script = (struct script *)
kmalloc (sizeof (struct script), M_DEVBUF, M_WAITOK);
if (np->script)
np->p_script = vtophys(np->script);
(ncrcmd *) np->script, sizeof(struct script));
struct script;
dsp <= np->p_script + sizeof(struct script)) {
script_size = sizeof(struct script);
script_base = (u_char *) np->script;
dsp <= np->p_script + sizeof(struct script)) {
vdsp_base = np->script;
script = optarg;
if (script != NULL) {
snprintf(cmd, sizeof(cmd), "%s %s", script, p->ifname);
"status %d", script, status);
static const char *script = NULL;
if (script == NULL) {
switch (script->type) {
if (strcmp(script->s, "-") == 0) {
if ((f = fopen(script->s, "r")) == NULL)
err(1, "%s", script->s);
fname = script->s;
sizeof(string_ident), "\"%s\"", script->s)) >=
s = script->s;
errx(1, "illegal script type: %d", script->type);
script = script->next;
if (s == script->s) {
script = script->next;
script = script->next;
static struct s_compunit *script, **cu_nextp = &script;
FILE *f, *script;
script = fopen(tmp_filename, "w");
if (script == NULL)
fprintf(script, "set | %susr/bin/sort >%senv.before\n", a->os_root, a->tmp);
fprintf(script, ". %s%s\n", a->os_root, filename);
fprintf(script, "set | %susr/bin/sort >%senv.after\n", a->os_root, a->tmp);
fprintf(script, "%susr/bin/comm -1 -3 %senv.before %senv.after | \\\n",
fprintf(script, " %susr/bin/awk -F= '{ print $1 }' | \\\n", a->os_root);
fprintf(script, " while read __VARNAME; do\n");
fprintf(script, " echo -n ${__VARNAME}=\n");
fprintf(script, " eval echo ' $'${__VARNAME}\n");
fprintf(script, " done\n");
fprintf(script, "%sbin/rm -f %senv.before %senv.after\n",
fclose(script);
*c->script = '\0';
*c->script = '\0';
strncpy(c->script, data, sizeof c->script - 1);
c->script[sizeof c->script - 1] = '\0';
c->argc = MakeArgs(c->script, c->argv, VECSIZE(c->argv), PARSE_NOHASH);
char script[LINE_LEN]; /* Our arg buffer */
strncpy(cx->cfg.script.dial, argp, sizeof cx->cfg.script.dial - 1);
cx->cfg.script.dial[sizeof cx->cfg.script.dial - 1] = '\0';
strncpy(cx->cfg.script.login, argp, sizeof cx->cfg.script.login - 1);
cx->cfg.script.login[sizeof cx->cfg.script.login - 1] = '\0';
strncpy(cx->cfg.script.hangup, argp, sizeof cx->cfg.script.hangup - 1);
cx->cfg.script.hangup[sizeof cx->cfg.script.hangup - 1] = '\0';
strncpy(cx->cfg.script.logout, argp, sizeof cx->cfg.script.logout - 1);
cx->cfg.script.logout[sizeof cx->cfg.script.logout - 1] = '\0';
arg->cx->cfg.script.dial);
arg->cx->cfg.script.login);
arg->cx->cfg.script.logout);
arg->cx->cfg.script.hangup);
dl->script.run = 1;
dl->script.packetmode = 1;
dl->script.run = 0;
if (!dl->script.packetmode) {
if (dl->script.run) {
if (!chat_Setup(&dl->chat, dl->cfg.script.logout, NULL))
if (dl->script.run) {
if (!chat_Setup(&dl->chat, dl->cfg.script.dial,
*dl->cfg.script.dial ?
if (dl->script.run) {
if (!chat_Setup(&dl->chat, dl->cfg.script.login, NULL))
if (dl->script.run) {
if (!chat_Setup(&dl->chat, dl->cfg.script.hangup, NULL))
if (!chat_Setup(&dl->chat, dl->cfg.script.hangup, NULL))
if (!chat_Setup(&dl->chat, dl->cfg.script.hangup, NULL))
if (dl->script.run && dl->state != DATALINK_OPENING) {
if (!chat_Setup(&dl->chat, dl->cfg.script.hangup, NULL))
if (!chat_Setup(&dl->chat, dl->cfg.script.logout, NULL))
*dl->cfg.script.dial = '\0';
*dl->cfg.script.login = '\0';
*dl->cfg.script.logout = '\0';
*dl->cfg.script.hangup = '\0';
dl->script.run = 1;
dl->script.packetmode = 1;
dl->script.run = runscripts;
dl->script.packetmode = packetmode;
if (!dl->script.run && runscripts)
dl->script.run = 1;
if (!dl->script.packetmode && packetmode) {
dl->script.packetmode = 1;
dl->script.run = 0;
} script;
} script; /* various chat scripts */
MakeArgs(char *script, char **pvect, int maxargs, int flags)
while (*script) {
script += strspn(script, " \t");
if (*script == '#' && !(flags & PARSE_NOHASH)) {
*script = '\0';
if (*script) {
*pvect++ = script;
script = findblank(script, flags);
if (script == NULL)
else if (!(flags & PARSE_NOHASH) && *script == '#')
*script = '\0';
else if (*script)
*script++ = '\0';