Current File : //etc/profile.d/motd.sh |
#!/bin/bash
if [ "`id -u`" -eq 0 ] && [ -t 0 ]; then
source /etc/os-release
read -a X <<< `stty size`
for i in $(seq 1 ${X[0]}); do echo '' ; done
tput cuu ${X[0]}
printf '#%.0s' {1..75}; echo
echo -e "\t\t\tWelcome!\n"
echo -e "This server is captured by $(tput setaf 6)FASTPANEL$(tput sgr0) control panel.\n"
echo -e "Operating System:\t$(tput setaf 6)$PRETTY_NAME$(tput sgr0)"
printf '=%.0s' {1..75}; echo
echo -e "IPv4:"
echo -e "$(tput setaf 6)"
ip a show scope global |grep -oP '(?<=inet )(\d{1,3}\.){3}\d{1,3}'
echo -e "$(tput sgr0)"
printf '=%.0s' {1..75}; echo
if [ `ip a show scope global |grep -c inet6` != "0" ]; then
echo -e "IPv6:"
echo -e "$(tput setaf 6)"
ip a show scope global |grep -Po '(?<=inet6 ).+(?=/\d{1,3})'
echo -e "$(tput sgr0)"
printf '=%.0s' {1..75}; echo
fi
echo -e "By default configuration files can be found in the following directories:"
echo
echo -e "$(tput setaf 6)NGINX:$(tput sgr0)\t\t/etc/nginx/fastpanel2-available"
echo -e "$(tput setaf 6)APACHE2:$(tput sgr0)\t/etc/apache2/fastpanel2-available\n"
echo -e "$(tput setaf 1)Please do not edit configuration files manually.$(tput sgr0)"
echo -e "$(tput setaf 1)You may do that in your control panel.$(tput sgr0)"
printf '=%.0s' {1..75}; echo
echo
uptime
printf '#%.0s' {1..75}; echo
fi