Skip to content

Instantly share code, notes, and snippets.

@t94xr
Last active August 28, 2022 03:00
Show Gist options
  • Save t94xr/3352ff1d1556d37ad6ee25ecfa680c0c to your computer and use it in GitHub Desktop.
Save t94xr/3352ff1d1556d37ad6ee25ecfa680c0c to your computer and use it in GitHub Desktop.
Login Script
#!/bin/bash
# Save this as /etc/profile.d/login.sh
# chmod +x login.sh
echo -e ""
echo -e "\e[1m$(cat /etc/hostname)\e[0m" "has been" "\e[32m$(uptime -p)\e[0m" "(since" "$(last reboot | grep still | awk '{print $5 " " $6 " " $7 " " $8}')"")"
echo -e "Local IP: " "$(ip addr | awk '/state UP/ {print $2}' | sed 's/.$//')" "$(hostname -I | awk '{print $1}')"
echo -e "WAN IP: " "$(dig @resolver4.opendns.com myip.opendns.com +short)"
echo -e ""
echo -e "$(inxi -s | grep cpu)"
echo -e ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment