mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-12 05:40:17 +00:00
13 lines
250 B
Bash
Executable file
13 lines
250 B
Bash
Executable file
#!/bin/bash
|
|
#bash hosts.sh domain.pl serwer.lh.pl
|
|
if [ $# -eq 2 ]; then
|
|
DOMAIN=$1
|
|
SERWER=$2
|
|
else
|
|
echo "DOMAIN:"
|
|
read DOMAIN
|
|
echo "SERWER:"
|
|
read SERWER
|
|
fi
|
|
IP=`dig +short A $SERWER | tr -d '\n'`
|
|
echo "$IP $DOMAIN www.$DOMAIN" | tee -a /etc/hosts
|