try to match with || again
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								92cbfa951b
							
						
					
				
			
			
				commit
				
					
						2f96602bed
					
				
			
		
					 8 changed files with 27 additions and 20 deletions
				
			
		| 
						 | 
					@ -5,6 +5,7 @@
 | 
				
			||||||
# cd "${dir}" && git init
 | 
					# cd "${dir}" && git init
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					set -x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dir=/home/users/nico/ethz/ftp
 | 
					dir=/home/users/nico/ethz/ftp
 | 
				
			||||||
site=ftp://ftp.ethz.ch/ETH
 | 
					site=ftp://ftp.ethz.ch/ETH
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,19 +1,20 @@
 | 
				
			||||||
#!/bin/sh -e
 | 
					#!/bin/sh -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "$USBHD" -o $# -ne 1 ]; then
 | 
					#if [ -z "$USBHD" -o $# -ne 1 ]; then
 | 
				
			||||||
   echo USBHD + interval
 | 
					#   echo USBHD + interval
 | 
				
			||||||
   exit 1
 | 
					#   exit 1
 | 
				
			||||||
fi
 | 
					#fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ccollect=/home/users/nico/lp/ccollect/ccollect/ccollect.sh
 | 
					ccollect=/home/users/nico/oeffentlich/rechner/projekte/ccollect/ccollect/ccollect.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# in pre_exec
 | 
					# in pre_exec
 | 
				
			||||||
#cryptsetup luksOpen /dev/sdc usbhd
 | 
					#cryptsetup luksOpen /dev/sdc usbhd
 | 
				
			||||||
#mount /home/services/usbhd 
 | 
					#mount /home/services/usbhd 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#cd /home/user/nico/p/ccollect/ccollect
 | 
					#cd /home/user/nico/p/ccollect/ccollect
 | 
				
			||||||
CCOLLECT_CONF=/home/users/nico/ethz/ccollect $ccollect "$1" ikn
 | 
					export CCOLLECT_CONF=/home/users/nico/ethz/ccollect
 | 
				
			||||||
 | 
					$ccollect $1 ikn$2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# in post_exec
 | 
					# in post_exec
 | 
				
			||||||
#umount /home/services/usbhd 
 | 
					#umount /home/services/usbhd 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,6 @@ count="$1"; shift
 | 
				
			||||||
for i in $(seq 1 16); do
 | 
					for i in $(seq 1 16); do
 | 
				
			||||||
   num=$(printf "%0.2d" $i) 
 | 
					   num=$(printf "%0.2d" $i) 
 | 
				
			||||||
   echo Trying $cluster/${num}:
 | 
					   echo Trying $cluster/${num}:
 | 
				
			||||||
   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}-ra${num} power off
 | 
					   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}${num}-ra power off
 | 
				
			||||||
   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}-ra${num} power status
 | 
					   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}${num}-ra power status
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,10 +28,11 @@ pass="$1"; shift
 | 
				
			||||||
cluster="$1"; shift
 | 
					cluster="$1"; shift
 | 
				
			||||||
count="$1"; shift
 | 
					count="$1"; shift
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -x
 | 
				
			||||||
for i in $(seq 1 16); do
 | 
					for i in $(seq 1 16); do
 | 
				
			||||||
   num=$(printf "%0.2d" $i) 
 | 
					   num=$(printf "%0.2d" $i) 
 | 
				
			||||||
   echo Trying $cluster/${num}:
 | 
					   echo Trying $cluster/${num}:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}-ra${num} power on
 | 
					   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}${num}-ra power on &
 | 
				
			||||||
   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}-ra${num} power status
 | 
					   ipmitool -U "$user" -P "$pass" -I lanplus -H ${cluster}${num}-ra power status &
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,11 +23,14 @@ export day="$(date +%d)"
 | 
				
			||||||
# 
 | 
					# 
 | 
				
			||||||
# for all other reservations: delete
 | 
					# for all other reservations: delete
 | 
				
			||||||
# 
 | 
					# 
 | 
				
			||||||
 | 
					   #sed 's/||/|/g'    | \
 | 
				
			||||||
 | 
					   #sed 's/|/||/g'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
curl --silent --netrc ${site} | \
 | 
					curl --silent --netrc ${site} | \
 | 
				
			||||||
   sed 's/||/|/g'    | \
 | 
					   awk 'BEGIN { FS="||" } 
 | 
				
			||||||
   awk -F'|' \
 | 
					      { print "- " $1 "--" }
 | 
				
			||||||
      '$4 !~ /(permanent|time-frame|^ *$)/ { 
 | 
					
 | 
				
			||||||
 | 
					      $4 !~ /(permanent|time-frame|^ *$)/ { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      orig = $0
 | 
					      orig = $0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,6 +56,5 @@ curl --silent --netrc ${site} | \
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
      # print unchangable lines
 | 
					      # print unchangable lines
 | 
				
			||||||
      $4 ~ /(permanent|time-frame|^ *$)/ { print $0 }
 | 
					      $4 ~ /(permanent|time-frame|^ *$)/ { print $0 }
 | 
				
			||||||
   ' | \
 | 
					   '
 | 
				
			||||||
   sed 's/|/||/g'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,13 +15,13 @@
 | 
				
			||||||
set -x
 | 
					set -x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ip l s eth0 down
 | 
					ip l s eth0 down
 | 
				
			||||||
( wpa_cli terminate; exit 0 )
 | 
					( wpa_cli terminate || exit 0 )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
( rmmod iwlagn; modprobe iwlagn; sleep 2 )
 | 
					# ( rmmod iwlagn; modprobe iwlagn; sleep 2 )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wpa_supplicant -B -Dwext -iwlan0 -c ~nico/ethz/wlan/wpa_supplicant.conf
 | 
					wpa_supplicant -B -Dwext -iwlan0 -c ~nico/ethz/wlan/wpa_supplicant.conf
 | 
				
			||||||
sleep 5
 | 
					sleep 5
 | 
				
			||||||
udhcpc -nqfi wlan0
 | 
					( udhcpc -nqfi wlan0 || dhcpcd wlan0 )
 | 
				
			||||||
vpnc ~nico/ethz/vpn/sg.conf
 | 
					vpnc ~nico/ethz/vpn/sg.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#vpnc ~nico/firmen/ethz/vpn/vpnc.conf
 | 
					#vpnc ~nico/firmen/ethz/vpn/vpnc.conf
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,8 +6,6 @@ BDIR=~/b/ikiwiki
 | 
				
			||||||
 | 
					
 | 
				
			||||||
START="$(date)"
 | 
					START="$(date)"
 | 
				
			||||||
PERL5LIB=${BDIR}  ${BDIR}/ikiwiki.in \
 | 
					PERL5LIB=${BDIR}  ${BDIR}/ikiwiki.in \
 | 
				
			||||||
	--libdir ${BDIR} \
 | 
					 | 
				
			||||||
	--templatedir ${BDIR}/templates \
 | 
					 | 
				
			||||||
	--setup ikiwiki.setup \
 | 
						--setup ikiwiki.setup \
 | 
				
			||||||
   "$@"
 | 
					   "$@"
 | 
				
			||||||
ret=$?
 | 
					ret=$?
 | 
				
			||||||
| 
						 | 
					@ -16,3 +14,5 @@ echo ${START} - ${END}: ikiwiki result: $?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#	-set underlaydir=${BDIR}/underlays/basewiki \
 | 
					#	-set underlaydir=${BDIR}/underlays/basewiki \
 | 
				
			||||||
#	-set underlaydirbase=${BDIR}/underlays \
 | 
					#	-set underlaydirbase=${BDIR}/underlays \
 | 
				
			||||||
 | 
					#	--libdir ${BDIR} \
 | 
				
			||||||
 | 
					#	--templatedir ${BDIR}/templates \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,5 @@
 | 
				
			||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[ -x /usr/bin/urxvtcd ] && exec /usr/bin/urxvtcd 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
exec urxvtc
 | 
					exec urxvtc
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue