-
Notifications
You must be signed in to change notification settings - Fork 31
/
autoshutdown.default
370 lines (296 loc) · 15.6 KB
/
autoshutdown.default
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# DEFAULT CONFIGURATION DEFINITION
###############################################################################
# Script Common Configuration
ENABLE="true"
# If the autoshutdown-script should be enabled or not. (default="true")
#
# Note: enabled/disabled does start the script on OMV, but then it checks,
# if the script is enabled or disabled. If it is "disabled", then the
# script stops with a log-message.
CYCLES=6
# Set the number of cycles with no result (no PC online etc.) before
# shutdown. (default=6) allowed is 1 - 999.
SLEEP=180
# Numbers of seconds between each Cycle (Check). (default=180, 3 min)
# allowed is 1 - 9999.
###############################################################################
# Script Checks
IPCHECK="true"
# Parameter to activate or deactivate this feature. (default="true")
RANGE="2..254,0x0..0xFFFF"
# Define a range of IPs which should be scanned. (default="2..254,
# 0x0..0xFFFF"). The 'RANGE' should be comma delimited list of the
# following:
# - Define an IPv4 range: <START>..<END> | iface@<START>..<END> |
# www.xxx.yyy.<START>..<END> |
# iface@xxx.yyy.zzz.<START>..<END>
# - Define a single IPv4: Last octet of IPv4 zzz | iface@zzz |
# www.xxx.yyy.zzz | iface@www.xxx.yyy.zzz
# - Define an IPv6 range: 0x<START>..0x<END> | iface@0x<START>..0x<END> |
# s:t:u:v:w:x:y:0x<START>..0x<END> |
# iface@s:t:u:v:w:x:y:0x<START>..0x<END>
# - Define a single IPv6: Last hextet of IPv6 0xzzzz | iface@0xzzzz |
# s:t:u:v:w:x:y:z | iface@s:t:u:v:w:x:y:z"
# - Define by FQDN : fqdn | iface@fqdn
# If '<START>..<END>' or 'Last octet of IPv4' is set the first three octets
# of the iface IPv4 address are used. If '0x<START>..0x<END>' or 'Last
# hextet of IPv6' is set the first seven hextets of the iface IPv6 address
# is used. Please make sure to leave 1 and 255 out of the IPv4 range!
# -----------------------------------------------------------------------------
CHECKCLOCKACTIVE="false"
# Parameter to activate or deactivate this feature (default="false") per
# default this is deactivated.
UPHOURS="06:00..20:00"
# Define a range of hours, in which the system should stay up
# (default="06:00..20:00") without checking any other parameter to stay
# awake.
# -----------------------------------------------------------------------------
WAKEALARM_SET="false"
# Parameter to activate or deactivate the WAKEALARM_SET feature
# (default="false") per default this is deactivated.
WAKEALARM="08:00"
# The time in 24 hour clock, the system should wake up at each day unless
# OVERRIDEWAKEALARM or WAKEALARM_UPHOURS are set. (default="08:00")
WAKEALARM_UPHOURS="false"
# If set "true" it will override WAKEALARM and OVERRIDEWAKEALARM and set
# them using the start times from UPHOURS and OVERRIDEUPHOURS. Note for this
# to work "CHECKCLOCKACTIVE must also be set to "true". (default="false")
# -----------------------------------------------------------------------------
CHECKSOCKETS="true"
# Parameter to activate or deactivate network socket feature.
# (default="true")
NSOCKETNUMBERS="21,22,80,3689,6991,9091,49152"
# Socket numbers to check for activity. See for more details:
# https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
# (default="21,22,80,3689,6991,9091,49152")
#
# Useful Ports:
# 21 = FTP
# 22 = SSH
# 80|8080 = HTTP
# 139 = NetBIOS
# 443 = HTTPS
# 445 = Microsoft-DS (Directory Services) SMB file sharing
# 548 = AFP
# 873 = Rsync
# 3306 = MYSQL
# 3689 = iTunes, DAAP
# 6991 = Bittorrent
# 9091 = Bittorrent_WebIF
# 49152 = UPnP
# Docker/Podman mapped ports can be used to check for activity. To used the
# set-up the container engine host port to be tested must be specified in
# NSOCKETNUMBERS.
# -----------------------------------------------------------------------------
ULDLCHECK="true"
# Set it to "true" for a network-traffic check. (default="true")
ULDLRATE=50
# Define the network traffic in kB/s in each cycle autoshutdown checks
# whether the network-traffic (upload or download) is over the set value
# over this value, no shutdown -> new check after x seconds (see SLEEP)
# below this value, your PC shuts-down, if all other checks are negative,
# too after the defined. (default=50)
# -----------------------------------------------------------------------------
LOADAVERAGECHECK="true"
# Set it to "true" for a check of load-average in autoshutdown. If the
# system is over this value, then no shutdown is issued. (default="true")
LOADAVERAGE=40
# Set this to the target load-average for the Server. (default=40)
# Make sure you leave the leading zeros and the dot out of the value!
# Example:
# LOADAVERAGE=50 # means a loadaverage of 0.50
# LOADAVERAGE=8 # means a loadaverage of 0.08
# LOADAVERAGE=220 # means a loadaverage of 2.20
# and so on ...
# -----------------------------------------------------------------------------
HDDIOCHECK="true"
# Set it to "true" for a check of HDD-IO over the last SLEEP-time in
# autoshutdown. If the system is over this value, then no shutdown is
# issued. (default="true")
HDDIO_RATE=401
# If a HDD-IO (read/write) is over a defined value in kB/s (default=401)
# and then don't shutdown the Server. This value is calculated with the
# SLEEP-time between every cycle of the script-checks. e.g.: You have
# defined HDDIO_RATE=2000 and the script sleep for 100 second then the
# HDD-IO (read or write) has to be over 200000kB (2000*100) within the last
# 100 sec to not shutdown the server.
# -----------------------------------------------------------------------------
SMARTCHECK="false"
# Do a HDD check to see if S.M.A.R.T. tests are running and if they are
# running block shutdown. Note this will only work if smart is supported
# directly. For example this will not work with a HPE smart array.
# (default="false")
# -----------------------------------------------------------------------------
CHECK_SAMBA="true"
# If set to "true", smbstatus will be checked for connected clients.
# (default="true")
# -----------------------------------------------------------------------------
CHECK_CLI="true"
# If set to "true", will check for connected users. (default="true")
# -----------------------------------------------------------------------------
CHECKPROCNAMES="true"
# If set to "true", will enable LOADPROCNAMES and TEMPPROCNAMES checks.
# (default="true")
LOADPROCNAMES="smbd,nfsd,mt-daapd,forked-daapd"
# Command names of processes with load dependent children checked.
# To disable the load process check set LOADPROCNAMES="-". (default="
# proftpd,smbd,nfsd,mt-daapd,forked-daapd")
TEMPPROCNAMES="in.tftpd"
# Command names of processes only started when active checked with "top"
# AND "ps", so all processes are found, even such, which doesn't show up in
# top like "lftp". Beware: If the process shows up in "ps" when there is no
# connection, your PC won't shutdown! Maybe you have to call the process
# in you script like this: "lftp -do -something -here && exit" so that the
# process is killed after it has done something checked. To disable the
# temp process check set to TEMPPROCNAMES="-". (default="in.tftpd")
# The following scheme is mandatory for both LOADPROCNAMES and
# TEMPPROCNAMES: process1,process2, all processes separated by comma ','.
# -----------------------------------------------------------------------------
PLUGINCHECK="false"
# PlugIns: You find sample plugins in /etc/autoshutdown.d. Set this to
# "true", if autoshutdown checks for PlugIns in /etc/autoshutdown.d set it
# to "false" to skip the check. (default="false")
#
# E.g.: When ClamAV does a check, the Server shouldn't shut down. How to do
# that? Let's look at a example: in the clamav-plugin for autoshutdown
# (etc/autoshutdown.d/clamav) the following is set:
#
# # In which folder is the file to look for
# folder="/var/run/clamav"
# # Enable or disable this plugin.
# enabled="true"
# # Filename (can be expanded with regexes)
# file="clamdscan-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
#
# Then, if a file i.e.: clamdscan-aaaa3556-adfe-5678-abcdef012345
# (or whatever UUID) in /var/run/clamav exists, the Server isn't shutdown.
#
# Also possible:
#
# folder="/home/user"
# enabled="true or false"
# file="backup.status"
# content="processing job"
#
# If a file /home/user/backup.status exists with the content 'processing
# job', the Server isn't shutdown. This is useful for backup-scripts. It
# is not nice if the PC is shutting down while the backup-script is
# running. In my backup-script I use a simple.
#
# echo "processing job" > /home/user/backup.status
#
# At the beginning and a
#
# rm /home/user/backup.status
#
# At the end of the script. In the boot-Phase also a
#
# rm /home/user/*.status
#
# To delete all *.status files, which are not deleted before (loss of power
# for example).
###############################################################################
# Syslog Configuration
SYSLOG="true"
# Activate write to syslog. (default="true")
VERBOSE="true"
# Use the verbose mode, with additional output on the command line
# (default="true") verbose includes DEBUG-Mode.
FAKE="true"
# Set it to "true" for a Fake-Mode: The script runs dry: You can test what
# happens, without shutting down your PC. This mode includes VERBOSE-output
# automatically, even if VERBOSE is set to "false". With Fake-Mode ON, the
# script does not sleep 5 minutes after it starts, so you can see what
# happens immediately. (default="true")
###############################################################################
# Expert Settings
# You should know, what you are doing. Add these settings to the "Expert
# Settings" text-field in the OMV-GUI.
# -----------------------------------------------------------------------------
CHECK_SAMBA_CLIENTS="false"
# Check if the SMB client is online or offline by sending a ping test to
# the client. For this to work all SMB client must respond to ping traffic
# or the test used will incorrectly classify the client as offline. This
# changes the script having to relying on the SMB lock timeout expiring
# before a shutdown is triggered on the server. (default="false)
# -----------------------------------------------------------------------------
LPREPEAT=5
# Number of test cycles for finding and active LOADPROCNAMES-Process
# allowed 1 - 999. (default=5)
TPREPEAT=5
# Number of test cycles for finding and active TEMPPROCNAMES-Process
# allowed 1 - 999. (default=5)
# -----------------------------------------------------------------------------
NSOCKETPORTMAP=""
# If set allow the used to define a string to be associated with a port if
# the port is found to be active. The port should be 2 to 5 digits as
# specified in $NSOCKETNUMBERS with an associated service name in the
# format: [<port1>:<service1>,<port2>:<service2>,...,<portN>:<serviceN>].
# (default="")
NSOCKETIGNORESELF="false"
# If set to "true" _check_net_status will ignore any sockets connected on
# the network interface being tested. (default="false")
NSOCKETSCLIENTSCHECK="false"
# Check if a client connected to a sockets is online or offline by sending
# a ping test to the client. For this to work all client must respond to
# ping traffic or the test used will incorrectly classify the client as
# offline. This changes the script having to relying on the client with
# long connection timeout that will have to expire before a shutdown is
# triggered on the server. (default="false)
# -----------------------------------------------------------------------------
SHUTDOWNCOMMAND="shutdown -h now"
# systemctl hibernate : Puts PC into hibernate-mode.
# systemctl suspend : Puts PC into suspend-mode.
# systemctl hybrid-sleep : Puts PC into hybrid-mode.
# systemctl suspend-then-hibernate : Puts PC into suspend-mode then uses an
# rtc-alarm to wake the system and go
# into hibernate-mode.
# shutdown -h +5 : Shut PC down in 5 min.
# shutdown -h now : Shut PC down immediately.(default)
# For more information and how to set up hibernate and suspend, look here:
# http://wiki.debian.org/Suspend
# http://wiki.debian.org/Hibernation
# -----------------------------------------------------------------------------
NET_IFACE_RETRY=12
# If a network interface is not found in unknown, dormant or up state this
# states how many times to retry the interface to see if it change to a
# one of the above mentioned states. This combiners with NET_IFACE_SLEEP to
# make the network interface retry mechanism. (default=12)
NET_IFACE_SLEEP=5
# The amount of time to sleep between re-checking a network interface
# state is valid. This combines with NET_IFACE_RETRYNET to make the network
# interface retry mechanism. (default=5)
# -----------------------------------------------------------------------------
FORCE_NIC="en eth wlan bond br usb"
# You can set network interfaces to look for an IP. This is useful, if you
# don't use eth0 make sure you insert a space between each network
# interface. Note you can use the first part of the network interface name
# to select all related interfaces i.e. eth will select eth0, eth1, ...
# This setting can also be used to optimise script start-up time so that
# only the relevant network interface are scanned, rather that the script
# having to scan all interface and wait for a valid response or timeout.
# (default="en eth wlan bond br usb")
# -----------------------------------------------------------------------------
RTC="rtc0"
# The systems real time clock that will be used by the script to set a
# wakealarm. (default="rtc0")
# -----------------------------------------------------------------------------
OVERRIDEUPHOURS=""
# Allows the overriding of UPHOURS for fixed days of the week. For
# example weekend. The format is sort day of week (for en.gb: Sun,Mon,Tue,
# Wed,Thu,Fri,Sat) colon, start time, double dot, stop time, comma, next
# override. e.g. Sat:06:30..23:00,Sun:06:30..22:00. (default="")
# -----------------------------------------------------------------------------
OVERRIDEWAKEALARM=""
# Allows the overriding of WAKEALARM for fixed days of the week. For
# example weekend. The format is sort day of week (for en.gb: Sun,Mon,Tue,
# Wed,Thu,Fri,Sat) colon, alarm time, comma, next override. e.g. Sat:06:30,
# Sun:06:30. Note this setting is overridden if WAKEALARM_UPHOURS is set
# "true". (default="")
# -----------------------------------------------------------------------------
PINGLIST=""
# Here you can define a path to a file, which contains list of IPs that
# should be scanned only one IP per line allowed - Format mmm.nnn.ooo.ppp
# e.g. 192.168.1.45 or FQDN e.g. openmediavault.local. If this
# expert-setting is used, the details specified in "RANGE" or in GUI
# are not used. (default="")