#!/bin/bash

system=$(cat /etc/os-release | sed -n 3p)

if [[ $system == *"arch"* ]] 
	then
		ip=$(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc')
elif [[ $system == *"debian"* ]] 
	then
		ip=$(hostname -I | awk '{print $1}')
fi

echo $ip

