blob: 091648b00b2f42dd29032a19500bec04ed9d93f3 (
plain) (
blame)
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
|
#!/bin/bash
. `dirname $0`/functions
option config standard_option
option port standard_option 80
option docroot standard_option /var/www
option chroot boolean_option 1
option symlink boolean_option 1
option user standard_option
option address standard_option
option logfile standard_option
option charset standard_option iso-8859-1
option bin reserved_option /usr/sbin/thttpd
# assign default values to options and variables before parsing the cfg file
function fct_begin_section {
pidfile="/var/run/thttpd-$2.pid"
cmdline='$bin ${opt_config:+-C $opt_config} ${opt_port:+-p $opt_port}
${opt_docroot:+-d $opt_docroot} ${opt_chroot:+-r} ${opt_symlink:+-s}
${opt_user:+-u $opt_user} ${opt_address:+-h $opt_address}
${opt_logfile:+-l $opt_logfile} ${opt_charset:+-T $opt_charset}
${pidfile:+-i $pidfile}'
}
load_config
|