Skip to content
This repository was archived by the owner on Mar 4, 2019. It is now read-only.

Commit 0d9d72a

Browse files
committed
Update domain.
1 parent 99b49ea commit 0d9d72a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

install/config/domain.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ It will modify the files:
1414
5) /var/www/bcl*/sites/default/settings.php
1515
"
1616

17+
### get the old domain
18+
old_domain=$(head -n 1 /etc/hosts.conf | cut -d' ' -f2)
19+
old_domain=${old_domain:-example.org}
20+
21+
### get the new domain
1722
if [ -z "${domain+xxx}" -o "$domain" = '' ]
1823
then
19-
domain='example.org'
20-
read -p "Enter the domain name for btr_client [$domain]: " input
21-
domain=${input:-$domain}
24+
read -p "Enter the domain name for btr_client [$old_domain]: " input
25+
domain=${input:-$old_domain}
2226
fi
2327

28+
### update /etc/hostname and /etc/hosts
2429
echo $domain > /etc/hostname
25-
old_domain=$(head -n 1 /etc/hosts.conf | cut -d' ' -f2)
2630
sed -i /etc/hosts.conf \
2731
-e "s/$old_domain/$domain/g"
2832
/etc/hosts_update.sh
2933

30-
### change config files
34+
### update config files
3135
for file in $(ls /etc/nginx/sites-available/bcl*)
3236
do
3337
sed -i $file -e "/server_name/ s/$old_domain/$domain/"

0 commit comments

Comments
 (0)