#!/bin/bash

network_card=$(ip link show |grep "state UP mode" |awk '{print $2 }')
echo $network_card

publicip=$(curl ifconfig.me)
echo $publicip

ifconfig $network_card"0"  $publicip netmask 255.255.255.0 up
echo "ifconfig $network_card"0"  $publicip netmask 255.255.255.0 up" >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
