#!/bin/bash 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