setup
branchipv6
changeset 7 13183092a453
parent 6 371a2568bc2e
child 8 f1e2fbfb530c
equal deleted inserted replaced
6:371a2568bc2e 7:13183092a453
     1 #! /bin/bash
     1 #! /bin/bash
     2 
     2 
     3 tmp=$(getopt -n setup -o n -l nothing -- "$@") \
     3 opt_n=
       
     4 opt_u=
       
     5 
       
     6 tmp=$(getopt -n setup -o nu -l nothing,update -- "$@") \
     4 	|| cat >&2 <<_
     7 	|| cat >&2 <<_
     5 Usage: $0 [-n|--nothing] [directories]
     8 Usage: $0 [-n|--nothing] [-u|--update] [directories]
     6 _
     9 _
     7 
    10 
     8 set -- $tmp
    11 set -- $tmp
     9 
    12 
    10 while : 
    13 while : 
    11 do
    14 do
    12 	opt="$1"; shift
    15 	opt="$1"; shift
    13 	case "$opt" in
    16 	case "$opt" in
    14 		-n|--nothing)	opt_n=-n;;
    17 		-n|--nothing)	opt_n=-n;;
       
    18 		-u|--update)	opt_u=1;;
    15 		--)		break;;
    19 		--)		break;;
    16 	esac
    20 	esac
    17 done
    21 done
    18 
    22 
    19 zypper install rsync tcpdump
    23 if test -n $opt_u; then
       
    24 	hg pull -u
       
    25 fi
       
    26 
       
    27 # install some packages we need for this script
       
    28 zypper install rsync
    20 
    29 
    21 getent group sudoers >/dev/null || groupadd --system sudoers
    30 getent group sudoers >/dev/null || groupadd --system sudoers
    22 for u in hans teilnehmer; do
    31 for u in hans teilnehmer; do
    23 	getent passwd $u >/dev/null && usermod -A sudoers $u
    32 	getent passwd $u >/dev/null && usermod -A sudoers $u
    24 done
    33 done
    25 
    34 
       
    35 # disable and switch off the firewall
    26 chkconfig SuSEfirewall2_setup off
    36 chkconfig SuSEfirewall2_setup off
    27 chkconfig SuSEfirewall2_init off
    37 chkconfig SuSEfirewall2_init off
       
    38 rcSuSEfirewall2 stop
    28 
    39 
    29 rsync  $opt_n -iav --exclude setup --exclude .hg ${@-*} /
    40 rsync  $opt_n -iav --exclude setup --exclude .hg ${@-*} /