File: fortune-temp.sh

package info (click to toggle)
licq 1.3.4-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,052 kB
  • ctags: 8,640
  • sloc: cpp: 76,924; sh: 9,845; ansic: 5,424; perl: 3,449; lex: 857; xml: 804; php: 691; makefile: 393; csh: 48
file content (40 lines) | stat: -rwxr-xr-x 1,448 bytes parent folder | download | duplicates (6)
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
#!/bin/bash
# This requires
# Arguments = '$a' $i
# PassMessage = 1
# PassMessage is 1 so we could read the user message.
# Arguments = '$a' (getting user Alias, make sure you use ' ') $i ( getting user IP address)
# Writen by Elius - www.buga-designs.com - ICQ: 124650632



# This line store the message the user sent to var MSG.
MSG=`tee`

# Checks for the user input and display the data according to it.
if [ "$MSG" = "1" ]; then
fortune SP
else
        if [ "$MSG" = "2" ]; then
        fortune
        else
                if [ "$MSG" = "3" ]; then
                cpu_temp=$(sensors | tail -n 7 | head -1 | cut -d "+" -f 2 | cut -d " " -f 1)
                mb_temp=$(sensors | tail -n 8 | head -1 | cut -d "+" -f 2 | cut -d " " -f 1)
                echo "CPU : $cpu_temp"
                echo "Chipset : $mb_temp"
                else
                        if [ "$MSG" = "4" ]; then
                        ping_time=$(ping -c 1 $2 | head -2 | cut -d "=" -f 4,9 | tail -n 1)
                        echo "Ping takes $ping_time"
                        else
                                echo " Hi $1"
                                echo " 1 - south park fortune"
                                echo " 2 - fortune"
                                echo " 3 - System temperature"
                        echo " 4 - Ping"
                        echo " Any other char - menu"
                        fi
                fi
        fi
fi