summaryrefslogtreecommitdiff
path: root/postpost/cpinputs
blob: 303e2ce93e3e136abe17780e54022c60ede539e4 (plain)
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
#!/bin/sh

for s in $1/lpic*
do
  if [ -d "$s" ]
  then
    for t in $s/*
    do
      if [ "`basename "$t" ".lpi"`.lpi" = "`basename "$t"`" ] || [ "`basename "$t" ".lpi"`.lpi" = "`basename "$t"`" ]
      then
        dir=$(basename "$(grep "path" "$t" | awk '{ print $3 }')")
        if [ -d "../$dir" ]
        then
          dir="../$dir"
        else
          if [ -d "../daten_alt/$dir" ]
          then
            dir="../daten_alt/$dir"
          else
            continue
          fi
        fi
        if [ -d "$dir/Post" ] && [ ! -e "$dir/Post/`basename "$t"`" ]
        then
          cp "$t" "$dir/Post/"
        fi
      fi
    done
  fi
done