22 lines
1,021 B
Bash
22 lines
1,021 B
Bash
|
# **************************************************************************** #
|
||
|
# #
|
||
|
# ::: :::::::: #
|
||
|
# where_am_i.sh :+: :+: :+: #
|
||
|
# +:+ +:+ +:+ #
|
||
|
# By: gtertysh <marvin@42.fr> +#+ +:+ +#+ #
|
||
|
# +#+#+#+#+#+ +#+ #
|
||
|
# Created: 2016/11/04 03:35:14 by gtertysh #+# #+# #
|
||
|
# Updated: 2016/11/04 04:01:02 by gtertysh ### ########.fr #
|
||
|
# #
|
||
|
# **************************************************************************** #
|
||
|
|
||
|
|
||
|
IPS=$(ifconfig | grep "inet " | cut -d " " -f2)
|
||
|
|
||
|
if [ -z "$IPS" ]
|
||
|
then
|
||
|
echo "Je suis perdu!"
|
||
|
else
|
||
|
echo $IPS | tr " " "\n"
|
||
|
fi
|