#!/bin/bash declare IMAGEKHANATSERVER="opennel/servercontainer_debian_stretch_x86_64" mkdir -p $HOME/Public echo "$(date "+%Y/%m/%d %H:%M:%S") Get ip address server khanat" listcontainer="$(docker ps -qf 'status=running' -f 'ancestor='"${IMAGEKHANATSERVER}"'')" if [[ ${#listcontainer[@]} -eq 1 ]] then ipaddress=$(docker inspect --format="{{ .NetworkSettings.IPAddress }}" ${listcontainer[@]}) fi echo "$(date "+%Y/%m/%d %H:%M:%S") get client package" wget http://$ipaddress/client/smokey_linux64.tar.gz -O smokey_linux64.tar.gz echo "$(date "+%Y/%m/%d %H:%M:%S") clean old client" if [[ -d Khanat_Linux64 ]] then rm -rf Khanat_Linux64 || exit 2 fi echo "$(date "+%Y/%m/%d %H:%M:%S") install new client" #7z x -y $SRCKHANATCLIENT || exit 2 #7z x -y -oKhanat_Linux64 $SRCKHANATCLIENTDEBUG || exit 2 tar xvzf smokey_linux64.tar.gz || exit 2 echo "$(date "+%Y/%m/%d %H:%M:%S") configure client" sed -i 's/lirria.khaganat.net/'$ipaddress'/g' Khanat_Linux64/client_default.cfg echo -en "Client khanat installed & configured\nGo to Khanat_Linux64 directory and launch client\n" echo -en "(cd Khanat_Linux64;./khanat_client)\n"