#!/bin/bashif["$(id -u)" !="0"];thenecho"This script must be run as root"1>&2exit1fiif[ -n "$1"];thenecho -e "\n192.168.10.10 \t $1" >> /etc/hosts;echo"Added entry to hosts for: $1";elseecho"Missing parameter HOST_NAME";fi
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.