You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					58 lines
				
				1.5 KiB
			
		
		
			
		
	
	
					58 lines
				
				1.5 KiB
			| 
								 
											2 years ago
										 
									 | 
							
								#!/bin/bash
							 | 
						||
| 
								 | 
							
								# info: list mail status
							 | 
						||
| 
								 | 
							
								# options:
							 | 
						||
| 
								 | 
							
								#
							 | 
						||
| 
								 | 
							
								# example: v-list-sys-mail-status
							 | 
						||
| 
								 | 
							
								#
							 | 
						||
| 
								 | 
							
								# This function lists mail server status
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								#                Variables & Functions                     #
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# Argument definition
							 | 
						||
| 
								 | 
							
								#format=${1-shell}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# Includes
							 | 
						||
| 
								 | 
							
								# shellcheck source=/etc/hestiacp/hestia.conf
							 | 
						||
| 
								 | 
							
								source /etc/hestiacp/hestia.conf
							 | 
						||
| 
								 | 
							
								# shellcheck source=/usr/local/hestia/func/main.sh
							 | 
						||
| 
								 | 
							
								source $HESTIA/func/main.sh
							 | 
						||
| 
								 | 
							
								# shellcheck source=/usr/local/hestia/conf/hestia.conf
							 | 
						||
| 
								 | 
							
								source $HESTIA/conf/hestia.conf
							 | 
						||
| 
								 | 
							
								# load config file
							 | 
						||
| 
								 | 
							
								source_conf "$HESTIA/conf/hestia.conf"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								#                       Action                             #
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# Checking mail system
							 | 
						||
| 
								 | 
							
								if [ -z "$MAIL_SYSTEM" ]; then
							 | 
						||
| 
								 | 
							
									exit
							 | 
						||
| 
								 | 
							
								fi
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# Displaying exim queue status
							 | 
						||
| 
								 | 
							
								echo "Exim queue status"
							 | 
						||
| 
								 | 
							
								exim -bp
							 | 
						||
| 
								 | 
							
								echo -en "\n---------------------------------------------"
							 | 
						||
| 
								 | 
							
								echo -en "---------------------------------------------\n\n"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# Displaying exim stats
							 | 
						||
| 
								 | 
							
								if [ -e "/var/log/exim4/mainlog" ]; then
							 | 
						||
| 
								 | 
							
									eximstats /var/log/exim4/mainlog 2> /dev/null
							 | 
						||
| 
								 | 
							
								else
							 | 
						||
| 
								 | 
							
									eximstats /var/log/exim/main.log 2> /dev/null
							 | 
						||
| 
								 | 
							
								fi
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if [ $? -ne 0 ]; then
							 | 
						||
| 
								 | 
							
									echo "[Exim4] No valid log lines read"
							 | 
						||
| 
								 | 
							
									exit 0
							 | 
						||
| 
								 | 
							
								fi
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								#                       Hestia                             #
							 | 
						||
| 
								 | 
							
								#----------------------------------------------------------#
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								exit 0
							 |