-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashinator.cfg.sh
201 lines (175 loc) · 7.8 KB
/
bashinator.cfg.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
## vim:ts=4:sw=4:tw=200:nu:ai:nowrap:
##
## bashinator config for lvm-snaptool
##
## Created by Wolfram Schlich <[email protected]>
## Licensed under the GNU GPLv3
## Web: http://www.bashinator.org/projects/lvm-snaptool/
## Code: https://github.com/wschlich/lvm-snaptool/
##
##
## bashinator settings
##
## -- bashinator basic settings --
## log stdout and/or stderr of subcommands to a file.
## the output of all subcommands need to be manually redirected to the logfile
## contained in the variable _L which is automatically defined by bashinator.
##
## examples:
##
## - redirect stdout + stderr to the logfile:
## mkdir /foo &> "${_L}"
##
## - redirect only stderr to the logfile, so stdout can be processed as usual:
## grep localhost /etc/hosts 2> "${_L}"
##
export __ScriptSubCommandLog=1 # default: 0
## directory to create logfile in
#export __ScriptSubCommandLogDir="/var/log" # default: /var/log
## check for a lockfile on startup and error out if it exists, create it otherwise
export __ScriptLock=1 # default: 0
## directory to create lockfile in
#export __ScriptLockDir="/var/lock" # default: /var/lock
## use a safe PATH environment variable instead
## of the one supplied by the calling environment:
## - when running as non-root user: /bin:/usr/bin
## - when running as super user: /sbin:/usr/sbin:/bin:/usr/bin
#export __ScriptUseSafePathEnv=1 # default: 1
## set the umask
#export __ScriptUmask=077 # default: 077
## generate a stack trace when the __die() function is called (fatal errors)
## affects printing, mailing and logging!
#export __ScriptGenerateStackTrace=1 # default: 1
## -- bashinator message handling settings --
## enable quiet operation: nothing is printed on stdout/stderr,
## messages are only logged and/or mailed (if enabled).
## overrides __Print* variables!
## it should be possible to enable this by passing -q
## as an argument to your own application script.
#export __MsgQuiet=0 # default: 0
## timestamp format for the message functions,
## will be passed to date(1).
## default: "%Y-%m-%d %H:%M:%S %:z"
export __MsgTimestampFormat="[%Y-%m-%d %H:%M:%S %:z]" # with brackets
#export __MsgTimestampFormat="[%Y-%m-%d %H:%M:%S.%N %:z]" # with brackets and nanoseconds
## -- bashinator message printing settings --
## enable/disable printing of messages by severity
#export __PrintDebug=0 # default: 0
#export __PrintInfo=0 # default: 1
#export __PrintNotice=0 # default: 1
#export __PrintWarning=0 # default: 1
#export __PrintErr=0 # default: 1
#export __PrintCrit=0 # default: 1
#export __PrintAlert=0 # default: 1
#export __PrintEmerg=0 # default: 1
## enable/disable prefixing the messages to be printed with...
##
## ...their timestamp
#export __PrintPrefixTimestamp=1 # default: 1
##
## ...their severity
#export __PrintPrefixSeverity=1 # default: 1
##
## ...their source (file name, line number and function name)
#export __PrintPrefixSource=1 # default: 1
## print severity prefixes
#export __PrintPrefixSeverity7=">>> [____DEBUG]" # LOG_DEBUG
#export __PrintPrefixSeverity6=">>> [_____INFO]" # LOG_INFO
#export __PrintPrefixSeverity5=">>> [___NOTICE]" # LOG_NOTICE
#export __PrintPrefixSeverity4="!!! [__WARNING]" # LOG_WARNING
#export __PrintPrefixSeverity3="!!! [____ERROR]" # LOG_ERR
#export __PrintPrefixSeverity2="!!! [_CRITICAL]" # LOG_CRIT
#export __PrintPrefixSeverity1="!!! [____ALERT]" # LOG_ALERT
#export __PrintPrefixSeverity0="!!! [EMERGENCY]" # LOG_EMERG
## print severity colors (for the entire message, not just the prefix)
#export __PrintColorSeverity7="1;34" # LOG_DEBUG: blue on default
#export __PrintColorSeverity6="1;36" # LOG_INFO: cyan on default
#export __PrintColorSeverity5="1;32" # LOG_NOTICE: green on default
#export __PrintColorSeverity4="1;33" # LOG_WARNING: yellow on default
#export __PrintColorSeverity3="1;31" # LOG_ERR: red on default
#export __PrintColorSeverity2="1;37;41" # LOG_CRIT: white on red
#export __PrintColorSeverity1="1;33;41" # LOG_ALERT: yellow on red
#export __PrintColorSeverity0="1;37;45" # LOG_EMERG: white on magenta
## -- bashinator message logging settings --
## enable/disable logging of messages by severity
#export __LogDebug=0 # default: 0
#export __LogInfo=0 # default: 1
#export __LogNotice=0 # default: 1
#export __LogWarning=0 # default: 1
#export __LogErr=0 # default: 1
#export __LogCrit=0 # default: 1
#export __LogAlert=0 # default: 1
#export __LogEmerg=0 # default: 1
## enable/disable prefixing the messages to be logged with...
##
## ...their timestamp (ignored for syslog log target)
#export __LogPrefixTimestamp=1 # default: 1
##
## ...their severity (ignored for syslog log target)
#export __LogPrefixSeverity=1 # default: 1
##
## ...their source (file name, line number and function name)
#export __LogPrefixSource=1 # default: 1
## log severity prefixes
#export __LogPrefixSeverity7=">>> [____DEBUG]" # LOG_DEBUG
#export __LogPrefixSeverity6=">>> [_____INFO]" # LOG_INFO
#export __LogPrefixSeverity5=">>> [___NOTICE]" # LOG_NOTICE
#export __LogPrefixSeverity4="!!! [__WARNING]" # LOG_WARNING
#export __LogPrefixSeverity3="!!! [____ERROR]" # LOG_ERR
#export __LogPrefixSeverity2="!!! [_CRITICAL]" # LOG_CRIT
#export __LogPrefixSeverity1="!!! [____ALERT]" # LOG_ALERT
#export __LogPrefixSeverity0="!!! [EMERGENCY]" # LOG_EMERG
## log target configuration
## supported targets (any comma separated combination of):
## - "syslog:FACILITY"
## - "file:TARGET-FILE"
## - "file:TARGET-FILE:WRITE-MODE" (default WRITE-MODE: overwrite)
## default: "syslog:user"
#export __LogTarget="syslog:user"
#export __LogTarget="file:/var/log/${__ScriptName}.log"
#export __LogTarget="file:/var/log/${__ScriptName}.log:append"
#export __LogTarget="file:/var/log/${__ScriptName}.log:overwrite"
#export __LogTarget="file:/var/log/${__ScriptName}.log:append,syslog:user"
#export __LogTarget="file:/var/log/${__ScriptName}.log:overwrite,syslog:user"
#export __LogTarget="file:/var/log/${__ScriptName}.log:append,file:/var/log/${__ScriptName}-current.log:overwrite"
#export __LogTarget="file:/var/log/${__ScriptName}.$(date +"%Y%m%d-%H%M%S").log"
## -- bashinator message mailing settings --
## enable/disable mailing of messages by severity
#export __MailDebug=0 # default: 0
export __MailInfo=0 # default: 1
export __MailNotice=0 # default: 1
#export __MailWarning=0 # default: 1
#export __MailErr=0 # default: 1
#export __MailCrit=0 # default: 1
#export __MailAlert=0 # default: 1
#export __MailEmerg=0 # default: 1
## enable/disable prefixing the messages to be mailed with...
##
## ...their timestamp
#export __MailPrefixTimestamp=1 # default: 1
##
## ...their severity
#export __MailPrefixSeverity=1 # default: 1
##
## ...their source (file name, line number and function name)
#export __MailPrefixSource=1 # default: 1
## mail severity prefixes
#export __MailPrefixSeverity7="[____DEBUG]" # LOG_DEBUG
#export __MailPrefixSeverity6="[_____INFO]" # LOG_INFO
#export __MailPrefixSeverity5="[___NOTICE]" # LOG_NOTICE
#export __MailPrefixSeverity4="[__WARNING]" # LOG_WARNING
#export __MailPrefixSeverity3="[____ERROR]" # LOG_ERR
#export __MailPrefixSeverity2="[_CRITICAL]" # LOG_CRIT
#export __MailPrefixSeverity1="[____ALERT]" # LOG_ALERT
#export __MailPrefixSeverity0="[EMERGENCY]" # LOG_EMERG
## enable/disable appending the script subcommand log to the mail (if enabled)
#export __MailAppendScriptSubCommandLog=1 # default: 1
## mail data configuration
## default __MailFrom: "${USER} <${USER}@${__ScriptHost}>"
## default __MailEnvelopeFrom: "${USER}@${__ScriptHost}"
## default __MailRecipient: "${USER}@${__ScriptHost}"
## default __MailSubject: "Messages from ${__ScriptFile} running on ${__ScriptHost}"
#export __MailFrom="${USER} <${USER}@${__ScriptHost}>"
#export __MailEnvelopeFrom="${USER}@${__ScriptHost}"
#export __MailRecipient="${USER}@${__ScriptHost}"
#export __MailSubject="Messages from ${__ScriptFile} running on ${__ScriptHost}"