Skip to content
systemctl_commands
\ No newline at end of file
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
domain=$1 domain=$1
ip=$2 ip=$2
cd /data/domains/$domain cd /data/domains/$domain
./BACKUP ./scripts/backup
systemctl stop u@$domain systemctl stop u@$domain
systemctl disable u@$domain systemctl disable u@$domain
tar cvzf /home/core/${domain}.tgz . tar cvzf /home/core/${domain}.tgz .
etcdctl --peers 172.17.42.1:4001 set /services/web/$domain '{"ip":"'$ip'", "port":"443"}'
#!/bin/bash
domain=`pwd | cut -d'/' -f4`
systemctl `basename "$0"` u@$domain
#!/bin/bash
cd /data/domains
my_ip=`curl http://ipv4.icanhazip.com/`
echo "My IP is $my_ip"
for domain in `ls .`; do
domain_ip=`host ${domain} | awk '/has address/ { print $4 }'`
if [[ "${domain_ip}" != "${my_ip}" ]]; then
echo "$domain has this IP: $domain_ip"
fi
done