Last active
October 7, 2024 05:07
-
-
Save hashfii/a8dc108031b72176f960e0a741fd8c35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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