~ubuntu-branches/debian/lenny/net-snmp/lenny

« back to all changes in this revision

Viewing changes to net-snmp-config.in

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • Revision ID: james.westby@ubuntu.com-20070510222023-3fr07xb9i17xvq32
Tags: upstream-5.3.1
ImportĀ upstreamĀ versionĀ 5.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
#
3
 
# $Id: net-snmp-config.in,v 5.32.2.8 2006/01/11 15:10:24 dts12 Exp $
 
3
# $Id: net-snmp-config.in,v 5.43.2.2 2006/06/12 23:01:31 tanders Exp $
4
4
#
5
5
# this shell script is designed to merely dump the configuration
6
6
# information about how the net-snmp package was compiled.  The
99
99
    --persistent-directory|--persistent-dir)
100
100
      echo @PERSISTENT_DIRECTORY@
101
101
      ;;
 
102
    --perlprog|--perl)
 
103
      echo @PERLPROG@
 
104
      ;;
102
105
    #################################################### compile
103
106
    --base-cflags)
104
107
      echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
200
203
      shift
201
204
      while test "x$done" = "x" -a "x$1" != "x" ; do
202
205
        case $1 in
203
 
            -A)
204
 
                shift
205
 
                if test "x$1" = "x" ; then
206
 
                    echo "You must specify an authentication algorithm"
207
 
                    exit 1
208
 
                fi
209
 
                Aalgorithm=$1
210
 
                shift
211
 
                ;;
212
 
            -X)
213
 
                shift
214
 
                if test "x$1" = "x" ; then
215
 
                    echo "You must specify an encryption algorithm"
216
 
                    exit 1
217
 
                fi
218
 
                Xalgorithm=$1
219
 
                shift
220
 
                ;;
221
 
            -a)
222
 
                shift
223
 
                if test "x$1" = "x" ; then
224
 
                    echo "You must specify an authentication pass phrase"
225
 
                    exit 1
226
 
                fi
227
 
                apassphrase=$1
228
 
                shift
229
 
                ;;
230
 
            -x)
231
 
                shift
232
 
                if test "x$1" = "x" ; then
233
 
                    echo "You must specify an encryption pass phrase"
234
 
                    exit 1
235
 
                fi
236
 
                xpassphrase=$1
237
 
                shift
 
206
            -A|-a)
 
207
                shift
 
208
                if test "x$1" = "x" ; then
 
209
                    echo "You must specify an authentication algorithm or pass phrase"
 
210
                    exit 1
 
211
                fi
 
212
                case $1 in
 
213
                MD5|SHA)
 
214
                    Aalgorithm=$1
 
215
                    shift
 
216
                    ;;
 
217
                md5|sha)
 
218
                    Aalgorithm=`echo $1 | tr a-z A-Z`
 
219
                    shift
 
220
                    ;;
 
221
                *)
 
222
                    apassphrase=$1
 
223
                    shift
 
224
                    ;;
 
225
                esac
 
226
                ;;
 
227
            -X|-x)
 
228
                shift
 
229
                if test "x$1" = "x" ; then
 
230
                    echo "You must specify an encryption algorithm or pass phrase"
 
231
                    exit 1
 
232
                fi
 
233
                case $1 in
 
234
                DES|AES|AES128)
 
235
                    Xalgorithm=$1
 
236
                    shift
 
237
                    ;;
 
238
                des|aes|aes128)
 
239
                    Xalgorithm=`echo $1 | tr a-z A-Z`
 
240
                    shift
 
241
                    ;;
 
242
                *)
 
243
                    xpassphrase=$1
 
244
                    shift
 
245
                    ;;
 
246
                esac
238
247
                ;;
239
248
            -ro)
240
249
                token="rouser"
397
406
    done
398
407
 
399
408
      cat >> $tmpfile <<EOF
400
 
static int keep_running;
 
409
extern int netsnmp_running;
401
410
 
402
411
RETSIGTYPE
403
412
stop_server(int a) {
404
 
    keep_running = 0;
 
413
    netsnmp_running = 0;
405
414
}
406
415
 
407
416
int
436
445
  /* $outname will be used to read $outname.conf files. */
437
446
  init_snmp("$outname");
438
447
 
439
 
  /* In case we recevie a request to stop (kill -TERM or kill -INT) */
440
 
  keep_running = 1;
 
448
  /* In case we received a request to stop (kill -TERM or kill -INT) */
 
449
  netsnmp_running = 1;
441
450
#ifdef SIGTERM
442
451
  signal(SIGTERM, stop_server);
443
452
#endif
446
455
#endif
447
456
 
448
457
  /* main loop here... */
449
 
  while(keep_running) {
 
458
  while(netsnmp_running) {
450
459
    agent_check_and_process(1);
451
460
  }
452
461
 
497
506
  echo ""
498
507
  echo "  SNMP Setup commands:"
499
508
  echo ""
500
 
  echo "    --create-snmpv3-user [-ro] [-a authpass] [-x privpass] [-X DES]"
501
 
  echo "                         [-A MD5|SHA] [username]"
 
509
  echo "    --create-snmpv3-user [-ro] [-A authpass] [-X privpass]"
 
510
  echo "                         [-a MD5|SHA] [-x DES|AES] [username]"
502
511
  echo ""
503
512
  echo "  These options produce the various compilation flags needed when"
504
513
  echo "  building external SNMP applications:"
553
562
  echo "    --default-mibdirs     display default list of MIB directories"
554
563
  echo "    --snmpconfpath        display default SNMPCONFPATH"
555
564
  echo "    --persistent-directory display default persistent directory"
 
565
  echo "    --perlprog            display path to perl for the perl modules"
556
566
  echo ""
557
567
  exit
558
568
fi