A script that will launch upon startup, or on command.

Checks a number of items including:

Checks the UFW firewall to ensure it’s activ

Checks Public and Private IP address

Checks to ensure NextDNS is running

Checks to see if IPv6 is disabled

Shows amount of storage space on your disk

Shows current Internet Connection


First, create a file within the terminal by entering the following command:

sudo nano startup_check.sh

Enter the following text:

#!/bin/bash
# Check if UFW is enabled, NextDNS is running, IPv6 is disabled, and show public/private IP addresses
# Written by GrapheneGoat.com 2024 (with special thanks to ChatGPT, cheating is fun!)
clear
echo “”
# Check public IP address
var_public=$(curl ifconfig.co)
clear
var_ufw=$(sudo ufw status verbose)

# Check if NextDNS is running
echo “”
var_nextdns=$(sudo nextdns status)

# Check if IPv6 is disabled at the kernel level
if [ “$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)” -eq 1 ]; then
echo “IPv6 is disabled.”
else
echo “IPv6 is enabled.”
fi
# Check local IP address
var_local=$(ip a | grep inet)
echo “”
echo “UFW”
echo $var_ufw
echo “”
echo “NextDNS Status:” $var_nextdns
echo “”
echo “Public IP address:” $var_public
echo “”
echo “Local IP address:”
echo $var_local
echo “”
echo “System Space:”
df -h | grep /dev/mapper/data-root

# Check which interfaces are connected
echo “”
echo “Connections:”
nmcli connection show

sleep 2
exit

Then hit Ctl + O and Enter to save, Ctl + X to exit.

Make the script executable by running the following command:

sudo chmod +x startup_check.sh

Run the script to test it:

sudo bash startup_check.sh

Then open your Applications menu and search for ‘Startup Applications’ and open it.

Click ‘Add’ and give it whatever name you want and enter this in the Command section:

gnome-terminal -- bash -c "~/startup_check.sh; exec bash"

Click Save and Exit. Your script will run upon each startup/reboot.