-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kanav Arora
committed
Jun 5, 2024
1 parent
131c28a
commit b47ed41
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#! /bin/bash | ||
|
||
|
||
|
||
echo "=========================================================" | ||
echo "$(figlet Find Me Here)" | ||
echo "=========================================================" | ||
|
||
if [ "$1" == "" ]; | ||
then | ||
echo "Script Usage:" | ||
echo "_________________________________" | ||
echo "| adddns -a ipaddress hostname |" | ||
echo "| adddns -d ipaddress |" | ||
echo "---------------------------------" | ||
fi | ||
|
||
|
||
|
||
if [ "$1" == "-a" ]; | ||
then | ||
echo "Adding DNS Entry" | ||
echo "$2 $3" >> /etc/hosts | ||
echo "DNS Entry Added" | ||
fi | ||
|
||
if [ "$1" == "-d" ]; | ||
then | ||
echo "Deleting DNS Entry" | ||
sed -i "/$2/d" /etc/hosts | ||
echo "DNS Entry Deleted" | ||
fi |