Snippets

Aryel Tupinambá CLI tool to add entry to hosts for Homestead

Created by Aryel Tupinambá
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

if [ -n "$1" ]; then
        echo -e "\n192.168.10.10 \t $1" >> /etc/hosts;
        echo "Added entry to hosts for: $1";
else
        echo "Missing parameter HOST_NAME";
fi

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.