![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHZh2cv3lR_8IL6l2sxN-UChM6GYB0TBwQJ74Gm0fPgdsrwkaeEVKbEIWGvInCf_uxnpI5SJv9bvIwvU1yTQz3c-TvKH7c9rw1Hq3qC_YFWtnYxgHnRwygGQ9h5orP4ij2jwfpgk8zcekm/s1600/bash_1.jpg)
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: