# 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: .. | iface@.. | # www.xxx.yyy... | # iface@xxx.yyy.zzz... # - 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..0x | iface@0x..0x | # s:t:u:v:w:x:y:0x..0x | # iface@s:t:u:v:w:x:y:0x..0x # - 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 '..' or 'Last octet of IPv4' is set the first three octets # of the iface IPv4 address are used. If '0x..0x' 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: [:,:,...,:]. # (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="")