File: configure

package info (click to toggle)
network-config 0.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 228 kB
  • ctags: 69
  • sloc: perl: 2,988; sh: 135; makefile: 119
file content (44 lines) | stat: -rwxr-xr-x 756 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash

#checks if a command exists
function command_exists
{
  if [[ ! -a $(which $1) ]]; then 
    echo " no";
    echo "    Warning, you don't have the command \"$1\"";
  else
    echo " yes";
  fi;
}

#check for commands
function check_commands
{
  for a in $@;
  do
    echo -n "Checking for \"$a\" command..."
    command_exists $a;
  done;
}

#main script starts here :

echo
echo "Configuring Network-config :"
echo

#root check
if [ "$(id -u)" != "0" ]; then
  echo "    Warning, this script must be run as root !"
  echo;
fi;

commands=(perl echo cat grep sort ifconfig iwconfig iwlist route \
iptables wpa_supplicant modprobe modinfo)

check_commands ${commands[@]}

echo
echo "Type \"make\" and after that \"make install\"."
echo