File: init.haproxy.flx0

package info (click to toggle)
haproxy 1.5.8-3%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 8,248 kB
  • ctags: 6,924
  • sloc: ansic: 62,867; xml: 1,754; python: 925; makefile: 551; perl: 550; sh: 491
file content (29 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

. `dirname $0`/functions

option	config		standard_option	/etc/haproxy/haproxy.cfg
option	bin		reserved_option	/usr/sbin/haproxy
option	cmdline		reserved_option	'$bin -f ${opt_config} -p ${pidfile} -D -q'

function do_help {
    echo "Usage: ${0##*/} <status|start|stop|help|conf>"
    echo "List of config.rc options (name, type, default value, current value) :"
    echo
    echo "   - config ; def=/etc/haproxy/haproxy.cfg ; cur=$opt_confdir"
    echo
    exit 1 
}

# reads the configuration file and checks its syntax.
function do_conf {
    $bin -c -V -q -f ${opt_config}
}

# assign default values to options and variables before parsing the cfg file
function fct_begin_section {
    pidfile="/var/run/haproxy${2:+-$2}.pid"
}

load_config