From 653ee01ec8856e6300cde9c06ff079bc6251787d Mon Sep 17 00:00:00 2001 From: Bram Kelchtermans Date: Sun, 7 Jul 2024 16:18:47 +0200 Subject: [PATCH] refactor: Update apt-cacher setup script to use IP address instead of hostname for the proxy server --- apt-cacher/setup.sh | 12 +++++++++++- gui/postman.sh | 1 + gui/setup.sh | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 gui/postman.sh diff --git a/apt-cacher/setup.sh b/apt-cacher/setup.sh index 239edcfc..49cf5c9e 100755 --- a/apt-cacher/setup.sh +++ b/apt-cacher/setup.sh @@ -1,2 +1,12 @@ #!/bin/bash -echo 'Acquire::http { Proxy "http://192.168.179.107:3142"; }' | sudo tee -a /etc/apt/apt.conf.d/proxy \ No newline at end of file + +IP="192.168.179.107" + +# Ping the IP address to check if it is reachable +if ping -c 1 $IP &> /dev/null +then + echo 'Acquire::http { Proxy "http://192.168.179.107:3142"; }' | sudo tee -a /etc/apt/apt.conf.d/proxy +else + echo "IP $IP is not reachable. Exiting." + exit 1 +fi diff --git a/gui/postman.sh b/gui/postman.sh new file mode 100755 index 00000000..3f5f38ab --- /dev/null +++ b/gui/postman.sh @@ -0,0 +1 @@ +snap install postman \ No newline at end of file diff --git a/gui/setup.sh b/gui/setup.sh index f47a4288..a70c4a52 100755 --- a/gui/setup.sh +++ b/gui/setup.sh @@ -6,4 +6,7 @@ chmod +x ./gui/spotify.sh ./gui/spotify.sh chmod +x ./gui/bluemail.sh -./gui/bluemail.sh \ No newline at end of file +./gui/bluemail.sh + +chmod +x ./gui/postman.sh +./gui/postman.sh \ No newline at end of file