#!/bin/bash
# The purpose of this script is to get general information about the system, security settings, network configuration, file system usage and current processes.
# The script does not contain any destructive commands.
# Platform: LINUX (tested on Red Hat, SUSE, Debian, Ubuntu)
# Usage: ./lnx.sh (as root)
# Last update: 09/07/2023
# Author: Miroslav Bernát <miroslav.bernat@prompt.cz>

# Delete output file
OUTPUT=$(hostname -s)_info.txt
[[ -e $OUTPUT ]] && rm $OUTPUT

# Set up redirects
exec 3>&1 4>&2
FIFO=fifo.$$
[[ -e $FIFO ]] || mkfifo $FIFO
tee $OUTPUT < $FIFO >&3 &
PID=$!
exec > $FIFO 2>&1

##### 1. SYSTEM INFORMATION #####
echo
echo "
####################################################################################################
#                                                                                                  #
#                                  ***** SYSTEM INFORMATION *****                                  #
#                                                                                                  #
####################################################################################################
"
echo
echo "Date and time zone ----->"
echo "$(date) $(if [[ -n $(which timedatectl 2> /dev/null) ]]; then timedatectl | grep "Time zone" | awk '{print $3}'; else cat /etc/timezone 2> /dev/null; fi)"
echo
echo "Hostname ----->"
hostname -s 2> /dev/null || hostnamectl hostname
echo
echo "System ----->"
uname -a
echo
echo "Release ----->"
dis=$(lsb_release -d 2> /dev/null | awk -F "\t" '{print $2}'); [[ -n "$dis" ]] && echo "$dis" || grep -E "^PRETTY_NAME" /etc/os-release | awk -F '"' '{print $2}'
echo
echo "System installation date ----->"
rpm -q basesystem --qf '%{installtime:date}\n' 2> /dev/null || echo "N/A"
echo
echo "System boot ----->"
if [[ -n $(which who 2> /dev/null) ]]; then who -b | awk '{print $3, $4}'; else uptime -s; fi
echo
echo "Runlevel ----->"
if [[ -n $(which who 2> /dev/null) ]]; then who -r | awk '{print $2}'; else runlevel | awk '{print $NF}'; fi
echo
echo "Virtual server ----->"
vs=$(dmidecode -s system-product-name | grep -Ei "virtual|vm|bochs|qemu"); [[ -z "$vs" ]] && echo "NO" || echo "YES, $vs"
echo
echo "Processor ----->"
lscpu 2> /dev/null | grep -iE '^(Model name|Core)' || sed '1,/^ *$/!d' /proc/cpuinfo | grep -iE '^(model name|cpu cores)'
echo
echo "Memory and swap usage ----->"
free -h 2> /dev/null || free
echo
echo "Hardware information ----->"
lspci; lsusb
echo
echo "Error log messages ----->"
journalctl -p err 2> /dev/null > errors.txt || grep -Ei "error|fail|valid" /var/log/messages /var/log/syslog /var/log/faillog /var/log/secure /var/log/auth.log 2> /dev/null > errors.txt; [[ ! -s errors.txt ]] && echo "N/A" || echo "YES, see 'errors.txt'."
echo
echo

##### 2. DEVICES AND PARTITIONS #####
echo "
####################################################################################################
#                                                                                                  #
#                                ***** DEVICES AND PARTITIONS *****                                #
#                                                                                                  #
####################################################################################################
"
echo
echo "Disks and partitions ----->"
fdisk -l /dev/[hsv]d? /dev/nvme??? 2> /dev/null | grep "dev" || parted -l
echo
lsblk 2> /dev/null && echo
lsscsi -svw 2> /dev/null && echo
echo "LVM implemented ----->"
lvm=$(pvs 2> /dev/null); [[ -z "$lvm" ]] && echo "NO" || echo "$lvm"
echo
echo "Multipath configured ----->"
mp=$(multipath -ll 2> /dev/null); [[ $? -ne 0 ]] && echo "NO" || echo "$mp" && echo
echo "Fibre channel host bus adapters ----->"
fca=$(lspci | grep -i fibre 2> /dev/null); [[ -z "$fca" ]] && echo "N/A" || echo "$fca"
echo
echo "Fibre channel HBA ports ----->"
fcp=$(ls -l /sys/class/fc_host/host* 2> /dev/null); [[ -z "$fcp" ]] && echo "N/A" || echo "$fcp"
echo
echo "Port status of the fibre channel HBA ----->"
fcp=$(grep -v "xyz" /sys/class/fc_host/host*/port_state 2> /dev/null); [[ -z "$fcp" ]] && echo "N/A" || echo "$fcp"
echo
echo "Fibre channel HBA WWNs ----->"
fcw=$(grep -v "xyz" /sys/class/fc_host/host*/port_name 2> /dev/null); [[ -z "$fcw" ]] && echo "N/A" || echo "$fcw"
echo
echo "Storage serial number and LUNs ----->"
ssn=$(for dev in $(ls /dev/mapper/mpath*); do sg_inq $dev | grep "serial number"; done 2> /dev/null); [[ -z "$ssn" ]] && echo "N/A" || echo "$ssn"
echo
echo

##### 3. FILE SYSTEMS #####
echo "
####################################################################################################
#                                                                                                  #
#                                     ***** FILE SYSTEMS *****                                     #
#                                                                                                  #
####################################################################################################
"
echo
echo "List of persistent file systems in /etc/fstab ----->"
if [[ -n $(which column 2> /dev/null) ]]; then fstab=$(grep -Ev '^$|^#' /etc/fstab | column -t); echo "$fstab"; echo --------------------; echo "lines:" $(echo "$fstab" | wc -l); else fstab=$(grep -Ev '^$|^#' /etc/fstab); echo "$fstab"; echo --------------------; echo "lines:" $(echo "$fstab" | wc -l); fi
echo
echo "Mounted file systems ----->"
if [[ -n $(which column 2> /dev/null) ]]; then mount | column -t ; echo --------------------; echo "lines: $(mount | wc -l)"; else mount; echo --------------------; echo "lines: $(mount | wc -l)"; fi
echo
echo "File system usage ----->"
df -hl 2> /dev/null || df -l
echo
echo "File systems with a used capacity equal to or greater than 90 % ----->"
fs=$(df -l | awk '+$5 >= 90 {print}'); [[ -z "$fs" ]] && echo "N/A" || echo "$fs"
echo
echo "Exported file systems ----->"
nfs=$(exportfs 2> /dev/null || showmount -e --no-headers 2> /dev/null); if [[ -z "$nfs" ]]; then echo "N/A"; else echo "$nfs"; echo --------------------; echo "lines:" $(echo "$nfs" | wc -l); fi
echo
echo "NFS status ----->"
nfss=$(/etc/init.d/nfsserver status 2> /dev/null || systemctl status nfs 2> /dev/null || service nfs status 2> /dev/null); if [[ -z "$nfss" ]]; then echo "N/A"; else echo "$nfss"; fi
echo
echo

##### 4. NETWORK CONFIGURATION #####
echo "
####################################################################################################
#                                                                                                  #
#                                 ***** NETWORK CONFIGURATION *****                                #
#                                                                                                  #
####################################################################################################
"
echo
echo "Network interfaces ----->"
ip addr show 2> /dev/null || ifconfig -a
echo
nmcli dev 2> /dev/null && echo && nmcli con 2> /dev/null && echo
echo "Kernel IP routing table ----->"
if [[ -n $(which netstat 2> /dev/null) ]]; then netstat -rn | tail -n +2; echo --------------------; echo "lines: $(netstat -rn | tail -n +2 | wc -l)"; else route -n | tail -n +2; echo --------------------; echo "lines: $(route -n | tail -n +2 | wc -l)"; fi
echo
echo "Current network connections ----->"
netstat -tupan 2> /dev/null || ss -tupan
echo
echo "SSH configuration ----->"
sshd -T 2> /dev/null | grep -Ei "^.?(Port|Protocol|PasswordAuthentication|PubkeyAuthentication|HostbasedAuthentication|PermitEmptyPasswords|PermitRootLogin|MaxAuthTries|ServerKeyBits|UsePAM|AllowUsers|DenyUsers|X11Forwarding)[ ]" || grep -E "^.?(Port|Protocol|PasswordAuthentication|PubkeyAuthentication|HostbasedAuthentication|PermitEmptyPasswords|PermitRootLogin|MaxAuthTries|ServerKeyBits|UsePAM|AllowUsers|DenyUsers|X11Forwarding)[ ]" /etc/ssh/sshd_config
echo
echo "Potentially vulnerable standard ports open ----->"
ports="avahi chargen daytime discard dns echo finger ldap ldaps netstat nntp nntps snmp systat time"; avahi="5353"; chargen="19"; daytime="13"; discard="9"; dns="53"; echo="7"; finger="79"; ldap="389"; ldaps="636"; netstat="15"; nntp="119"; nntps="563"; snmp="161"; systat="11"; time="37"; for port in $ports; do open_ports=$(if [[ -n $(which netstat 2> /dev/null) ]]; then netstat -antu | awk 'NR>2{print $4}'; else ss -antu | awk 'NR>1{print $5}'; fi | awk -F ":" '{print $NF}' | grep -Ew "${!port}$" | uniq); if [[ -n "$open_ports" ]]; then echo "${port} ---> YES"; else echo "${port} ---> NO"; fi; done
ports="cups dtspcd ftp http https imap imaps pop3 pop3s rexec rlogin rsh rsync smb smtp smtps squid telnet"; cups="631"; dtspcd="6112"; ftp="21"; http="80"; https="443"; imap="143"; imaps="993"; pop3="110"; pop3s="995"; rexec="512"; rlogin="513"; rsh="514"; rsync="873"; smb="445"; smtp="25"; smtps="465"; squid="3128"; telnet="23"; for port in $ports; do open_ports=$(if [[ -n $(which netstat 2> /dev/null) ]]; then netstat -ant | awk 'NR>2{print $4}'; else ss -ant | awk 'NR>1{print $5}'; fi | awk -F ":" '{print $NF}' | grep -Ew "${!port}$" | uniq); if [[ -n "$open_ports" ]]; then echo "${port} ---> YES"; else echo "${port} ---> NO"; fi; done
ports="bootps nmb rwho talk tftp who"; bootps="67"; nmb="137"; rwho="513"; talk="517"; tftp="69"; who="513"; for port in $ports; do open_ports=$(if [[ -n $(which netstat 2> /dev/null) ]]; then netstat -anu | awk 'NR>2{print $4}'; else ss -anu | awk 'NR>1{print $5}'; fi | awk -F ":" '{print $NF}' | grep -Ew "${!port}$" | uniq); if [[ -n "$open_ports" ]]; then echo "${port} --> YES"; else echo "${port} --> NO"; fi; done
ports="cmsd nfs pcnfsd rstatd rusersd rwalld sprayd ttdbserver"; for port in $ports; do open_ports=$(rpcinfo -p 2> /dev/null | grep -i $port); if [[ -n "$open_ports" ]]; then echo "${port} ---> YES"; else echo "${port} ---> NO"; fi; done
echo
echo "Repositories enabled ----->"
zypper lr -E 2> /dev/null || yum repolist 2> /dev/null || apt update > /dev/null 2>&1 && apt-cache policy 2> /dev/null | grep "http" | awk '{print $2, $3, $4, $5}'
echo
echo

##### 5. CLUSTER STATUS AND CONFIGURATION #####
echo "
####################################################################################################
#                                                                                                  #
#                           ***** CLUSTER STATUS AND CONFIGURATION *****                           #
#                                                                                                  #
####################################################################################################
"
echo
echo "Cluster status ----->"
cl=$(pcs status 2> /dev/null || crm status 2> /dev/null || clustat 2> /dev/null || hastatus 2> /dev/null); [[ -z "$cl" ]] && echo "N/A" || echo "$cl"
echo
echo

##### 6. CURRENT PROCESSES #####
echo "
####################################################################################################
#                                                                                                  #
#                                  ***** CURRENT PROCESSES *****                                   #
#                                                                                                  #
####################################################################################################
"
echo
echo "Current processes ----->"
services="maestro httpd tomcat sendmail postfix pmon lsnr db2sysc sybase mysql mariadb postgresql sap mqm appserver weblogic spazio mbd baan dsm domino cdpmgr nagios lcf itm tems nfsd seo"; for service in $services; do running_processes="$(ps -ef | grep -i $service | grep -Ev 'grep|vnc|client|API|baseos')"; if [ -n "$running_processes" ]; then echo; echo $service:; echo; echo "$running_processes"; echo --------------------; echo "lines: $(echo "$running_processes" | wc -l)"; echo; echo xxxxxxxxxxxxxxxxxxxx; fi; done; echo; echo "Summary:"; echo; ps -ef; echo --------------------; echo "lines: $(ps -ef | wc -l)"
echo
echo "Container applications ----->"
ca=$(docker ps -q 2> /dev/null || podman ps -q 2> /dev/null || lxc-ls --active 2> /dev/null); [[ -z "$ca" ]] && echo "N/A" || docker ps 2> /dev/null || podman ps 2> /dev/null || lxc-ls --active 2> /dev/null
echo
echo "Jobs managed by crontab ----->"
crontab -l; echo --------------------; echo "lines: $(crontab -l | wc -l)"
echo
echo "Potentially vulnerable services enabled ----->"
if [[ -n $(which systemctl 2> /dev/null) ]]; then { vs1=$(systemctl list-unit-files -t service | grep -Ew "avahi-daemon|bind|cups|dhcpd|dhcp-server|dnsmasq|dovecot|finger|http|ldap|named|^nfs[ ]|nfs-server|nmb|postfix|rexec|rlogin|rpcbind|rsh|rstatd|rsync|rusersd|sendmail|slapd|smb|snmp|squid|telnet|tftp|vsftpd|who|xinetd" | grep "enabled" | awk '{print $1}'); [[ -n "$vs1" ]] && echo "$vs1";}; else if [[ -n $(which chkconfig 2> /dev/null) ]]; then { vs2=$(chkconfig --list | grep -Ei "avahi-daemon|bind|cups|dhcpd|dhcp-server|dnsmasq|dovecot|finger|http|ldap|named|^nfs[ ]|nfs-server|nmb|postfix|rexec|rlogin|rpcbind|rsh|rstatd|rsync|rusersd|sendmail|slapd|smb|snmp|squid|telnet|tftp|ttdbserver|vsftpd|who|xinetd" | grep "on" | awk '{print $1}'); [[ -n "$vs2" ]] && echo "$vs2";}; fi; fi
if [[ -f /etc/xinetd.conf ]]; then { vs3=$(grep -R "disable" /etc/xinetd.d | grep "no"); [[ -n "$vs3" ]] && echo "$vs3";}; else if [[ -f /etc/inetd.conf ]]; then { vs4=$(sed '/^[^#]/!d' /etc/inetd.conf | grep -E 'bootps|chargen|cmsd|daytime|discard|dtspcd|echo|finger|ftp|imap|netstat|nntp|pcnfsd|pop-3|rexd|rexec|rlogin|rsh|rstatd|rsync|rusersd|rwalld|rwho|sprayd|systat|talk|telnet|tftp|time|ttdbserver|who'); [[ -n "$vs4" ]] && echo "$vs4";}; fi; fi
[[ -z "$vs1" && -z "$vs2" && -z "$vs3" && -z "$vs4" ]] && echo "N/A"
echo
echo

##### 7. USER INFORMATION #####
echo "
####################################################################################################
#                                                                                                  #
#                                   ***** USER INFORMATION *****                                   #
#                                                                                                  #
####################################################################################################
"
echo
echo "Users on the system ----->"
if [[ -n $(which getent 2> /dev/null) ]]; then getent passwd; echo --------------------; echo "lines:" $(getent passwd | wc -l); else cat /etc/passwd; echo --------------------; echo "lines:" $(cat /etc/passwd | wc -l); fi
echo
echo

##### 8. SECURITY SETTINGS #####
echo "
####################################################################################################
#                                                                                                  #
#                                   ***** SECURITY SETTINGS *****                                  #
#                                                                                                  #
####################################################################################################
"
echo
echo "Default PASS_MIN_LEN ----->"
sed '/^[^#]*minlen/!d' /etc/security/pwquality.conf 2> /dev/null | awk -F "=" '{print $2}' | grep -Eo "[0-9]*" || { pml=$(sed '/^[^#]/!d' /etc/pam.d/system-auth /etc/pam.d/common-password /etc/security/pam_pwcheck.conf 2> /dev/null | grep -Eo "minlen=[0-9]*" | awk -F "=" '{print $2}'); if [[ -n "$pml" ]]; then echo $pml; else pml=$(sed '/^[^#]*PASS_MIN_LEN/!d' /etc/login.defs | awk '{print $2}' 2> /dev/null); if [[ -n "$pml" ]]; then echo "$pml"; else echo "N/A"; fi; fi;}
echo
echo "Default PASS_MIN_DAYS ----->"
sed '/^[^#]*PASS_MIN_DAYS/!d' /etc/login.defs | awk '{print $2}'
echo
echo "Default PASS_MAX_DAYS ----->"
sed '/^[^#]*PASS_MAX_DAYS/!d' /etc/login.defs | awk '{print $2}'
echo
echo "Current PASS_MIN_DAYS and PASS_MAX_DAYS for users with a password assigned ----->"
pa=$(awk -F ":" '{if (length($2) > 2) print $1}' /etc/shadow); for usr in $pa; do grep -E "^$usr" /etc/shadow | awk -F ":" '{printf "%-15s %-15s %-15s\n", $1, $4, $5}'; done
[[ -n $(ps -ef | grep "seos" | grep -v "grep") ]] && { echo ""; echo "==> Etrust is used, never expiring passwords are allowed.";}
echo
echo "Password history ----->"
sed '/^[^#]/!d' /etc/pam.d/system-auth /etc/pam.d/common-password /etc/security/pam_pwcheck.conf 2> /dev/null | grep -Eo "remember=[0-9]*" || echo "N/A"
echo
echo "Loginretries ----->"
lr1=$(sed '/^[^#]/!d' /etc/pam.d/system-auth /etc/pam.d/common-auth /etc/pam.d/common-account 2> /dev/null | grep -Eo "deny=[0-9]*"); if [[ -n "$lr1" ]]; then echo "$lr1"; else lr2=$(sed '/^[^#]*LOGIN_RETRIES/!d' /etc/login.defs 2> /dev/null | awk '{print $2}'); if [[ -n "$lr2" ]]; then echo "$lr2"; else echo "N/A"; fi; fi
echo
echo "Empty password assigned ----->"
ep=$(awk -F ":" '{if (length($2) == 0) print $1}' /etc/shadow); [[ -n "$ep" ]] && printf "Empty password assigned in /etc/shadow for user: \n$ep\n" && echo || echo "No empty password assigned in /etc/shadow."
echo
echo "Root password assignment and expiration ----->"
rp=$(grep "root" /etc/shadow | awk -F ":" '{print $2}'); [[ "${#rp}" -gt 2 ]] && echo -n "Password assigned, " || echo -n "Password is incorrect, "; echo "PASS_MAX_DAYS="$(grep "root" /etc/shadow | awk -F ":" '{print $5}')
echo
echo "Sudo implemented ----->"
[[ -n $(sudo -l 2> /dev/null) ]] && echo "YES" || echo "NO"
echo
echo "Duplicate UIDs ----->"
duid=$(awk -F ":" '{print $3}' /etc/passwd | sort | uniq -d); [[ -z "$duid" ]] && echo "N/A" || grep -E "$duid:[0-9]" /etc/passwd
echo
echo "Duplicate GIDs ----->"
dgid=$(awk -F ":" '{print $3}' /etc/group | sort | uniq -d); [[ -z "$dgid" ]] && echo "N/A" || grep -E "$dgid" /etc/group
echo
echo "Never expiring password for user ----->"
ne=$(awk -F ":" '{if (length($2) > 2 && ($5 == "" || $5 >= 99999)) print $1}' /etc/shadow); [[ -z "$ne" ]] && echo "N/A" || echo "$ne" | tr " " "\n"
[[ -n $(ps -ef | grep "seos" | grep -v "grep") ]] && { echo ""; echo "==> Etrust is used, never expiring passwords are allowed.";}
echo
echo "General users with locked accounts ----->"
la=$(for user in $(awk -F ":" '{if ($7 ~ /.+(sh|bash|ksh|zsh)$/ && ($3 == 0 || $3 >= 500)) print $1}' /etc/passwd); do passwd -S $user | grep "LK"; done); [[ -z "$la" ]] && echo "N/A" || echo "$la"
echo
echo "Passwords stored in /etc/passwd for user ----->"
pp=$(awk -F ":" '{if (length($2) > 2) print $1}' /etc/passwd); [[ -z "$pp" ]] && echo "N/A" || echo "$pp" | tr " " "\n"
echo
echo "Password encryption method ----->"
em=$(sed '/^[^#]*\(sha[25]\|md5\|des\|bcrypt\|yescript\)/!d' /etc/pam.d/system-auth /etc/pam.d/common-password 2> /dev/null | grep -Eo "sha[1256]{3}|md5|des|bcrypt|yescript"); if [[ -n "$em" ]]; then echo "$em"; else sed '/^[^#]*ENCRYPT_METHOD/!d' /etc/login.defs | awk '{print $NF}'; fi
echo
echo "Passwords encrypted ----->"
[[ -n $(ps -ef | grep "seos" | grep -v "grep") ]] && echo "==> Etrust is used, passwords may be encrypted in a different way." || { np=$(awk -F ":" '{if (length($2) > 2 && $2 !~ /^(!|!!)?(\$[1256y][abxy]?\$)/) print $1}' /etc/shadow); if [[ -z "$np" ]]; then echo "YES, all passwords are encrypted."; else echo "Password may not be encrypted or is incorrect for user:"; echo "$np" | tr " " "\n"; fi;}
echo
echo "Default umask value ----->"
redhat=$(sed '/^[^#]*umask/!d;q' /etc/bashrc 2> /dev/null | awk '{print $NF}'); suse=$(sed '/^[^#]*umask/!d' /etc/profile.local 2> /dev/null | awk '{print $2}'); ubuntu=$(sed '/^[^#]*UMASK/!d' /etc/login.defs 2> /dev/null | awk '{print $2}'); if [[ -n "$redhat" ]]; then echo "$redhat"; elif [[ -n "$suse" ]]; then echo "$suse"; else echo "$ubuntu"; fi
echo
echo "Default umask for home directories ----->"
sed '/^[^#]*UMASK/!d' /etc/login.defs 2> /dev/null | awk '{print $2}'
echo
echo "Home directories with permissions different from the value of 700 ----->"
homedir=$(awk -F ":" '{if ($7 ~ /.+(sh|bash|ksh|zsh)$/ && ($3 == 0 || $3 >= 500)) print $6}' /etc/passwd | xargs ls -ld 2> /dev/null | grep -Ev "^drwx------"); [[ -z "$homedir" ]] && echo "N/A" || echo "$homedir"
echo
echo "Home directories with non-standard ownership ----->"
io=$(for a in $(awk -F ":" '{if ($7 ~ /.+(sh|bash|ksh|zsh)$/ && ($3 == 0 || $3 >= 500)) print $6}' /etc/passwd); do b=$(stat -c %U $a 2> /dev/null); c=$(stat -c %G $a 2> /dev/null); d=$(echo $a | awk -F "/" '{print $NF}'); if [[ "$b" != "$d" || "$c" != $(id -ng "$b") ]]; then ls -ld "$a"; fi; done); [[ -z "$io" ]] && echo "N/A" || echo "$io"
echo
echo "Private ssh keys protection ----->"
pk1=$(for home in $(awk -F : '{print $6}' /etc/passwd); do ls -l ${home}/.ssh/id_[rd]sa 2> /dev/null | grep -Ev "^-rw-------"; done); pk2=$(for file in /etc/ssh/ssh_host*key; do ls -l $file | grep -Ev "^-rw-------" | grep -v "ssh_keys"; done); [[ -n "$pk1" ]] && { echo "KO ==>"; echo "$pk1";}; [[ -n "$pk2" ]] && { echo "KO ==>"; echo "$pk2";}; [[ -z "$pk1" && -z "$pk2" ]] && echo "OK"
echo
echo "Writable files for others ----->"
files="/etc /opt /tmp /usr /var"; for file in $files; do find $file \( -type f -o -type d \) -perm -o=w -exec ls -adl {} \; 2> /dev/null; done | grep -Ev '^[l]|^[d].{8}t' || echo "N/A"
echo
echo "Log retention ----->"
echo $(grep -EA1 'rotate log files weekly|weeks worth of backlogs' /etc/logrotate.conf | sed -n '2p;5p')
echo
echo "SELinux status ----->"
[[ -n $(getenforce 2> /dev/null) ]] && getenforce || echo "N/A"
echo
echo
echo ">>>>>The output of the script has been saved to '$(hostname -s)_info.txt'.<<<<<"
echo

# Exit tee and clean up
exec 1>&3 2>&4 3>&- 4>&-
wait $PID
rm $FIFO
exit 0

# EOF

