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

Commit

Permalink
Update domain.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashohoxha committed Oct 11, 2014
1 parent 99b49ea commit 0d9d72a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions install/config/domain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ It will modify the files:
5) /var/www/bcl*/sites/default/settings.php
"

### get the old domain
old_domain=$(head -n 1 /etc/hosts.conf | cut -d' ' -f2)
old_domain=${old_domain:-example.org}

### get the new domain
if [ -z "${domain+xxx}" -o "$domain" = '' ]
then
domain='example.org'
read -p "Enter the domain name for btr_client [$domain]: " input
domain=${input:-$domain}
read -p "Enter the domain name for btr_client [$old_domain]: " input
domain=${input:-$old_domain}
fi

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

### change config files
### update config files
for file in $(ls /etc/nginx/sites-available/bcl*)
do
sed -i $file -e "/server_name/ s/$old_domain/$domain/"
Expand Down

0 comments on commit 0d9d72a

Please sign in to comment.