Feb 24, 2017

0 Show IP address on prelogin message


Bash script to show IP address on prelogin message.

#!/bin/bash

# Check if root
if [ `id -u` != 0 ]; then
    echo "Run as root."
    exit
fi

# Create script
touch /etc/network/if-up.d/show_ip
chmod +x /etc/network/if-up.d/show_ip

# This will happen on boot.
cat > /etc/network/if-up.d/show_ip <<'_EOF'
#!/bin/bash
rm -rf /etc/issue && touch /etc/issue
lsb_release -sd >> /etc/issue
hostname -I >> /etc/issue
_EOF

echo "Job's Done!"





0 comments :

Post a Comment

Comment: