Skip to content

Instantly share code, notes, and snippets.

@hashfii
Last active October 7, 2024 05:07
Show Gist options
  • Save hashfii/a8dc108031b72176f960e0a741fd8c35 to your computer and use it in GitHub Desktop.
Save hashfii/a8dc108031b72176f960e0a741fd8c35 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Tentukan path ke setiap file config.ini di folder yang berbeda
config_files=(
"/opt/ping_exporter/config.ini"
"/opt/speedtest/config.ini"
"/opt/streamvideo/config.ini"
"/opt/traceroute/config.ini"
# Tambahkan path ke setiap file config lainnya di sini
)
# Iterasi melalui setiap file
for file in "${config_files[@]}"; do
# Ubah nilai setup menjadi yes menggunakan sed
sed -i 's/setup = no/setup = yes/g' "$file"
done
# Restart service dan container
sudo systemctl stop prometheus.service && sudo systemctl start prometheus.service && sudo systemctl stop streamvideo.service && docker restart ping_exporter && docker restart traceroute && docker restart speedtest && sudo systemctl start streamvideo.service
echo "Semua service test berhasil di restart."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment