#!/bin/bash
red=$(tput setaf 1)
green=$(tput setaf 2)
reset=$(tput sgr 0)


backup_dir='./backup/backup_20240607T035511.tar.gz'

files="./data/eltex-airtune/etc/eltex-airtune/airtune.conf
       ./data/eltex-airtune/etc/eltex-airtune/airtune_logger.conf
       ./data/eltex-apb/etc/eltex-apb/hosts.json
       ./data/eltex-apb/etc/eltex-apb/hosts_kassa.json
       ./data/eltex-ngw/etc/eltex-ngw/gateway.d/email.conf
       ./data/eltex-ngw/etc/eltex-ngw/gateway.d/smg.conf
       ./data/eltex-ngw/etc/eltex-ngw/gateway.d/smsc.conf
       ./data/eltex-ngw/etc/eltex-ngw/gateway.d/smpp.conf
       ./data/eltex-ngw/etc/eltex-ngw/gateway.d/sbc.conf
       ./data/eltex-pcrf/etc/eltex-pcrf/hazelcast-cluster-network.xml"

for item in ${files}
do
  echo "EXTRACTING $item"
  if tar -xzvf $backup_dir $item; then
    echo "${green}File $item has been restored successfully!${reset}"
  else
    echo "${red}Error occured while files${reset}"
  fi
done


