2 # Script from Frans Pop
7 echo "Usage: insserv-seq-changes /var/lib/insserv/<old bootscripts tarball>"
11 oldtar="$(tar tzf $1)"
12 for i in S $(seq 0 6); do
14 new="$(cd /etc/rc$i.d; ls -1 [KS]* | sort | nl)"
15 old="$(echo "$oldtar" | grep "^rc$i.d/[KS]" | cut -d/ -f2 | sort | nl)"
18 old="$(echo "$old" | sed -r "s/[KS][0-9]+//")"
19 new="$(echo "$new" | sed -r "s/[KS][0-9]+//")"
22 old="$(echo "$old" | sed -r "s/([KS])[0-9]+/\1_/")"
23 new="$(echo "$new" | sed -r "s/([KS])[0-9]+/\1_/")"
26 echo "$new" | while read num cmd; do
27 oldnum=$(echo "$old" | grep "[[:space:]]$cmd$" | awk '{print $1}')
28 if [ "$oldnum" ]; then
29 diff=$(($num - $oldnum))
34 if [ ${#cmd} -ge 16 ]; then
35 echo -e "$cmd\t$num\t$oldnum\t$diff"
36 elif [ ${#cmd} -ge 8 ]; then
37 echo -e "$cmd\t\t$num\t$oldnum\t$diff"
39 echo -e "$cmd\t\t\t$num\t$oldnum\t$diff"
42 echo "$old" | while read num cmd; do
43 if ! echo "$new" | grep -q "[[:space:]]$cmd$"; then
44 if [ ${#cmd} -ge 16 ]; then
45 echo -e "$cmd\t---\t$oldnum"
46 elif [ ${#cmd} -ge 8 ]; then
47 echo -e "$cmd\t\t---\t$oldnum"
49 echo -e "$cmd\t\t\t---\t$oldnum"