aboutsummaryrefslogtreecommitdiffstats
path: root/process-scripts.sh
blob: 184d5d5647f733c16a4a8f68f2cfb2c98bd3ece6 (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
31
32
#!/bin/bash

# Boot scripts
for s in lsb-bootscripts/etc/init.d/*                    \
         lsb-bootscripts/etc/default/*                 \
         lsb-bootscripts/sbin/* \
         lsb-bootscripts/lib/network-services/*
do
  script=$(basename $s)
  
  # Skip directories
  [ $script == 'sbin' ] && continue
  [ $script == 'network-services'        ] && continue

  # Disambiguate duplicate file names
  [ $s == 'lsb-bootscripts/etc/default/rc'      ] && script='rc-sysinit'; 
  [ $s == 'lsb-bootscripts/etc/default/modules' ] && script='modules-sysinit'; 
  
  sed  -e 's/\&/\&amp\;/g' -e 's/</\&lt\;/g'   -e 's/>/\&gt\;/g' \
       -e "s/'/\&apos\;/g" -e 's/"/\&quot\;/g' -e 's/\t/    /g'  \
       $s > appendices/${script}.script 
done

# Udev rules
for s in udev-config/*.rules
do
  script=$(basename $s)

  sed  -e 's/\&/\&amp\;/g' -e 's/</\&lt\;/g'   -e 's/>/\&gt\;/g' \
       -e "s/'/\&apos\;/g" -e 's/"/\&quot\;/g' -e 's/\t/    /g'  \
       $s > appendices/${script}.script 
done