--- /usr/sbin/update-rc.d	Mon Jul 14 07:51:11 1997
+++ update-rc.d	Sun Oct 12 18:04:08 1997
@@ -1,8 +1,8 @@
 #! /usr/bin/perl
 #
-# update-rc.d	Update the links in /etc/rc[0-6].d/
+# update-rc.d	Update the links in /etc/rc[0-9S].d/
 #
-# Version:	@(#)update-rc.d.pl  2.00  21-Dec-1996  miquels@cistron.nl
+# Version:	@(#)update-rc.d.pl  2.01  12-Oct-1997  miquels@cistron.nl
 #
 
 $initd = "/etc/init.d";
@@ -59,7 +59,7 @@
 
 exit (0);
 
-# Check if there are links in /etc/rc[0-6].d/ 
+# Check if there are links in /etc/rc[0-9S].d/ 
 # Remove if the first argument is "remove" and the links 
 # point to $bn.
 
@@ -89,9 +89,11 @@
 
     $found = 0;
 
-    foreach $i (0..6) {
-	chdir ("$etcd$i.d") ||
+    foreach $i (0..9, 'S') {
+	unless (chdir ("$etcd$i.d")) {
+	    next if ($i =~ m/^[789S]$/);
 	    die("update-rc.d: chdir $etcd$i.d: $!\n");
+	}
 	opendir(DIR, ".");
 	foreach $_ (readdir(DIR)) {
 	    next unless (/^[S|K][0-9]*$bn$/);
@@ -155,7 +157,7 @@
 	shift @ARGV; shift @ARGV;
 	$level = shift @ARGV;
 	do {
-	    if ($level !~ /^[0-9]$/) {
+	    if ($level !~ m/^[0-9S]$/) {
 		&usage(
 		       "update-rc.d: expected runlevel 0-9 (did you forget \".\" ?)");
 	    }
@@ -164,6 +166,7 @@
 		    "update-rc.d: $etcd$level.d: no such directory\n";
 		exit(1);
 	    }
+	    $level = 99 if ($level eq 'S');
 	    $startlinks[$level] = "$letter$NN" if ($letter eq 'S');
 	    $stoplinks[$level]  = "$letter$NN" if ($letter eq 'K');
 	} while (($level = shift @ARGV) ne '.');
@@ -190,10 +193,12 @@
     for($t = 0; $t < 2; $t++) {
 	@links = $t ? @startlinks : @stoplinks;
 	for($i = 0; $i <= $#links; $i++) {
+	    $lvl = $i;
+	    $lvl = 'S' if ($i == 99);
 	    next if ($links[$i] eq '');
-	    print "   $etcd$i.d/$links[$i]$bn -> ../init.d/$bn\n";
+	    print "   $etcd$lvl.d/$links[$i]$bn -> ../init.d/$bn\n";
 	    next if ($notreally);
-	    symlink("../init.d/$bn", "$etcd$i.d/$links[$i]$bn")
+	    symlink("../init.d/$bn", "$etcd$lvl.d/$links[$i]$bn")
 		|| die("update-rc.d: symlink: $!\n");
 	}
     }
