-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathme.sh
53 lines (43 loc) · 905 Bytes
/
me.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#/bin/bash
#set -x
argc=$#
if [ $argc -eq 1 ]; then
sleep=$1
fi
./nokia r
./nokia c 59
hostname=`hostname`
./nokia +a $hostname
. /etc/os-release
IFS=' '
set -- $VERSION_CODENAME
./nokia +2 "$1"
eth0=`sudo ifconfig -a | grep -c eth0`
if [ $eth0 == "1" ]; then
ipaddr=`sudo ifconfig eth0 |grep "inet" |awk {'print $2'} |cut -f2 -d:`
./nokia +c "Ethernet"
./nokia +4 $ipaddr
else
./nokia +c "No eth0"
fi
ipaddr=""
wlan=`sudo ifconfig -a | grep -c wlan0`
if [ $wlan == "1" ]; then
ipaddr=`sudo ifconfig wlan0 |grep "inet" |awk {'print $2'} |cut -f2 -d:`
fi
wlan=`sudo ifconfig -a | grep -c wlan1`
if [ $wlan == "1" ]; then
ipaddr=`sudo ifconfig wlan1 |grep "inet" |awk {'print $2'} |cut -f2 -d:`
fi
if [ -z ${ipaddr} ]; then
./nokia +e "No wlan"
else
./nokia +e "WiFi"
./nokia +6 $ipaddr
fi
sudo ./nokia s
if [ $argc -eq 1 ]; then
sleep $sleep
./nokia r
sudo ./nokia s
fi