73 lines
2.0 KiB
Bash
Executable File
73 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# this scripts upadte all servers located in hetenzer
|
|
|
|
# uplink main uplink
|
|
rm -rf uplink.urmic.org
|
|
git clone https://devdatt:$1@git.dbhatt.org/serverwa/uplink.urmic.org.git
|
|
cd uplink.urmic.org
|
|
cp nginx.conf /etc/nginx/
|
|
rm -rf uplink.urmic.org
|
|
systemctl reload nginx
|
|
|
|
# uplink1.urmic.org
|
|
uplink1_rtmp_ips=("37.27.21.27" "185.193.19.223" "137.59.95.164")
|
|
UPLINK1_RTMP=$(cat <<EOF
|
|
rm -rf uplink1.urmic.org
|
|
echo "Pulling latest changes from remote Git..."
|
|
git clone https://devdatt:$1@git.dbhatt.org/serverwa/uplink1.urmic.org.git
|
|
cd uplink1.urmic.org
|
|
cp nginx.conf /etc/nginx/
|
|
systemctl reload nginx
|
|
rm -rf uplink1.urmic.org
|
|
EOF
|
|
)
|
|
for ip in "${uplink1_rtmp_ips[@]}"; do
|
|
ssh -i id_rsa -o StrictHostKeyChecking=no root@$ip "$UPLINK1_RTMP"
|
|
echo "Current ip: $ip"
|
|
done
|
|
|
|
|
|
# update streamer.urmic.org
|
|
STREAMER_URMIC_ORG=$(cat <<EOF
|
|
rm -rf streamer.urmic.org
|
|
echo "Pulling latest changes from remote Git..."
|
|
git clone https://devdatt:$1@git.dbhatt.org/serverwa/streamer.urmic.org.git
|
|
cd streamer.urmic.org
|
|
cp icecast.xml /etc/icecast2/
|
|
systemctl reload icecast2
|
|
rm -rf streamer.urmic.org
|
|
EOF
|
|
)
|
|
ssh -i id_rsa -o StrictHostKeyChecking=no root@$ip "$STREAMER_URMIC_ORG"
|
|
|
|
|
|
# update channels.urmic.org
|
|
channel_rtmp_ips=("172.16.99.181" "172.16.99.182" "172.16.99.183" "172.16.99.184" "172.16.99.185" "172.16.99.186" "172.16.99.187")
|
|
CHANNEL_URMIC_ORG=$(cat <<EOF
|
|
rm -rf channel.urmic.org
|
|
echo "Pulling latest changes from remote Git..."
|
|
git clone https://devdatt:$1@git.dbhatt.org/serverwa/channel.urmic.org.git
|
|
cd channel.urmic.org
|
|
cp nginx.conf /etc/nginx/
|
|
systemctl reload nginx
|
|
rm -rf channel.urmic.org
|
|
EOF
|
|
)
|
|
for ip in "${channel_rtmp_ips[@]}"; do
|
|
ssh -i id_rsa -o StrictHostKeyChecking=no root@$ip "$CHANNEL_URMIC_ORG"
|
|
echo "Current ip: $ip"
|
|
done
|
|
|
|
# x86 cdn ips
|
|
x86_cdn_ips=("172.16.99.181" "172.16.99.182" "172.16.99.183")
|
|
DD_URMIC_ORG=$(cat <<EOF
|
|
cd dd.urmic.org
|
|
|
|
EOF
|
|
)
|
|
|
|
for ip in "${x86_cdn_ips[@]}"; do
|
|
ssh -i id_rsa -o StrictHostKeyChecking=no root@$ip "$CHANNEL_URMIC_ORG"
|
|
echo "Current ip: $ip"
|
|
done
|