Created
July 9, 2024 23:03
-
-
Save orafaelfragoso/74f05783d7f32666cbb213d79ad7cfb9 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 | |
# Function to show a loading indicator | |
show_loading() { | |
echo -n "..." | |
sleep 0.5 | |
echo -n "..." | |
sleep 0.5 | |
echo -n "..." | |
sleep 0.5 | |
} | |
# Step 1: Edit /etc/docker/daemon.json | |
echo -n "Editing /etc/docker/daemon.json" | |
show_loading | |
if [ ! -f /etc/docker/daemon.json ]; then | |
sudo touch /etc/docker/daemon.json | |
fi | |
sudo bash -c 'cat <<EOF > /etc/docker/daemon.json | |
{ | |
"dns": [ | |
"172.17.0.1", | |
"127.0.0.53" | |
] | |
} | |
EOF' > /dev/null 2>&1 | |
echo -e "\rEditing /etc/docker/daemon.json OK" | |
# Step 2: Restart Docker | |
echo -n "Restarting Docker service" | |
show_loading | |
sudo service docker restart > /dev/null 2>&1 | |
echo -e "\rRestarting Docker service OK" | |
# Step 3: Navigate to ~/dev/hud/ns0 and run command | |
echo -n "Running docker-dns install command" | |
show_loading | |
cd ~/dev/hud/ns0 | |
sudo ./bin/docker-dns install -t hu/ns0 -d hud -n ns0 > /dev/null 2>&1 | |
echo -e "\rRunning docker-dns install command OK" | |
echo "All tasks completed successfully!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment