Magellan Linux

Diff of /trunk/distcc/distcc-config.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 144 by niro, Tue May 8 20:06:05 2007 UTC revision 943 by niro, Tue Dec 1 10:41:10 2009 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  #distcc-config bash  # distcc-config bash
3    
4  #needed variables  # needed variables
5  ENVFILE="/etc/env.d/02distcc"  ENVFILE="/etc/env.d/02distcc"
6    
   
7  print_usage()  print_usage()
8  {  {
9   echo   echo
# Line 24  while getopts "s:pih-" opt Line 23  while getopts "s:pih-" opt
23  do  do
24   case "$opt" in   case "$opt" in
25    
26   #sets hosts   # sets hosts
27   s)   s)
28   [ ! -d /etc/distcc ] && install -d /etc/distcc   [ ! -d /etc/distcc ] && install -d /etc/distcc
29   echo "${OPTARG}" > /etc/distcc/hosts   echo "${OPTARG}" > /etc/distcc/hosts
30   exit 0   exit 0
31   ;;   ;;
32    
33  # #sets logfile  # # sets logfile
34  #       l)  #       l)
35  # echo ${OPTARG}  # echo ${OPTARG}
36  # exit 0  # exit 0
37  # ;;  # ;;
38  #  #
39  # #set verbose  # # set verbose
40  # v)  # v)
41  # echo ${OPTARG}  # echo ${OPTARG}
42  # exit 0  # exit 0
43  # ;;  # ;;
44    
45   #print config   # print config
46   p)   p)
47   echo "Configured hosts:"   echo "Configured hosts:"
48   declare -i x=0   declare -i x=0
# Line 60  do Line 59  do
59       [ "$(stat -c %s /etc/distcc/hosts)" -ne 0 ]       [ "$(stat -c %s /etc/distcc/hosts)" -ne 0 ]
60   then   then
61   echo "     /etc/distcc/hosts:"   echo "     /etc/distcc/hosts:"
62   for i in $(cat /etc/distcc/hosts)   (cat /etc/distcc/hosts; echo) | # make sure there is a LF at the end
63     while read line
64   do   do
65     case "${line}" in
66     \#*|"") continue ;;
67     esac
68   ((x++))   ((x++))
69   echo "                   ${x}. ${i}"   echo "                   ${x}. ${line}"
70   done   done < /etc/distcc/hosts
71   else   else
72   echo "     None. Please run distcc-config."   echo "     None. Please run distcc-config."
73   echo "     e.g. distcc-config -s \"host1 host2\""   echo "     e.g. distcc-config -s \"host1 host2\""
# Line 72  do Line 75  do
75   echo   echo
76   exit 0   exit 0
77   ;;   ;;
78    
79   #install compiler symlinks   # install compiler symlinks
80   i)   i)
81   source /etc/mage.rc   source /etc/mage.rc
82   for file in gcc cc c++ g++   for file in gcc cc c++ g++
# Line 98  do Line 101  do
101   done   done
102   exit 0   exit 0
103   ;;   ;;
104    
105   #show help   #show help
106   h)   h)
107   print_usage   print_usage
108   exit 0   exit 0
109   ;;   ;;
110    
111           -)   -)
112   break   break
113   ;;   ;;
114    
115          *)   *)
116   echo "Run '/usr/bin/distcc-config -h' for help." 1>&2   echo "Run '/usr/bin/distcc-config -h' for help." 1>&2
117   exit 1   exit 1
118   ;;   ;;

Legend:
Removed from v.144  
changed lines
  Added in v.943