File: update-audit

package info (click to toggle)
firehol 3.1.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,768 kB
  • sloc: sh: 20,852; makefile: 827; perl: 554; sed: 12
file content (29 lines) | stat: -rwxr-xr-x 567 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

for i in "$@"
do
  case $i in
    *.conf)
       out=$(echo $i | sed -e 's/\.conf$/.out/')
       aud=$(echo $i | sed -e 's/\.conf$/.aud/')
       out4="${out}4"
       out6="${out}6"
       aud4="${aud}4"
       aud6="${aud}6"
       if [ -f "$out4" -a -f "$out6" ]
       then
         cp "$out4" "$aud4"
         cp "$out6" "$aud6"
       elif [ -f "$out" ]
       then
         cp "$out" "$aud"
       else
         echo "$i: neither .out nor .out4+.out6 found"
       fi
    ;;

    *)
      echo "$i: can only process .conf files"
    ;;
  esac
done