File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # transfer file to our remote server
2
+ # print domains and subdomains
3
3
4
- if [ $# -lt 3 ]
4
+ print_domain_subdomain () {
5
+ dig " $1 " | grep -A1 ' ANSWER SECTION:' | sed -r " s/$1 ./$2 /g" | awk -F" " ' NR==2 { print "The subdomain " $1 " is a " $4 " record and points to " $5 }'
6
+ }
7
+
8
+ if [ " $# " -eq 2 ]
5
9
then
6
- echo " Usage: 0-transfer_file PATH_TO_FILE IP USERNAME PATH_TO_SSH_KEY "
10
+ print_domain_subdomain " $2 . $1 " " $2 "
7
11
else
8
- if [ $# -eq 4 ]
9
- then
10
- scp -o StrictHostKeyChecking=no -i " $4 " " $1 " " $3 " @" $2 " :~ /
11
- else
12
- scp -o StrictHostKeyChecking=no " $1 " " $3 " @" $2 " :~ /
13
- fi ;
14
- fi ;
12
+ print_domain_subdomain " www.$1 " " www"
13
+ print_domain_subdomain " lb-01.$1 " " lb-01"
14
+ print_domain_subdomain " web-01.$1 " " web-01"
15
+ print_domain_subdomain " web-02.$1 " " web-02"
16
+ fi
You can’t perform that action at this time.
0 commit comments