You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
810 B
33 lines
810 B
8 years ago
|
#!/usr/bin/bash
|
||
|
if [ $1 ]; then
|
||
|
case $1 in
|
||
|
-h|--help)
|
||
|
echo "Add entrys to your hosts file"
|
||
|
echo ""
|
||
|
echo -e "addhost domain.com\t\t\t\tadds domain.com to your hosts and points to local machine"
|
||
7 years ago
|
echo -e "addhost (alex|aaron|jonathan|vps01|vps02) domain.com\tadds domain.com to your hosts and points to persons machine"
|
||
8 years ago
|
;;
|
||
|
alex)
|
||
|
echo -e "10.0.1.201\t$2" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
|
aaron)
|
||
|
echo -e "10.0.1.202\t$2" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
|
jonathan)
|
||
|
echo -e "10.0.1.203\t$2" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
7 years ago
|
vps01)
|
||
|
echo -e "130.185.147.131\t$2" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
|
vps02)
|
||
|
echo -e "130.185.147.137\t$2" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
8 years ago
|
*)
|
||
|
echo -e "127.0.0.1\t$1" | sudo tee -a /etc/hosts
|
||
|
;;
|
||
|
esac
|
||
|
else
|
||
|
echo "You need to add at least a domain"
|
||
|
fi
|
||
|
|