--- Services.pm.bak	Wed Feb 11 23:05:55 2004
+++ Services.pm	Thu Feb 12 00:44:18 2004
@@ -431,12 +431,9 @@
 	my $quiet = shift || 0;
 	my ($retval, $cmd, $tempfile);
 
-	$script =~ s/[\r\n]+$//s;			# Remove empty lines
-	$script =~ s/^\s*//;					# Remove white spaces from the start of each line
-
 	# If the script starts with a shell specified (e.g. #!/bin/sh), run it 
 	# as a script. Otherwise fall back to the old behaviour for compatibility.
-	if ($script =~ /^#!/) {
+	if ($script =~ /^\s*#!/) {
 		# Put the script into a temporary file and run it.
 		$tempfile = POSIX::tmpnam() or die "unable to get temporary file: $!";
 		open (OUT, ">$tempfile") or die "unable to write to $tempfile: $!";
@@ -451,6 +448,8 @@
 		}
 		return $retval;
 	} elsif (defined $script and $script ne "") {
+		# Unfold multiline commands into one line
+	        $script =~ s/\s*\\\n\s*/ /g;
 		# Execute each line as a separate command.
 		foreach $cmd (split(/\n/,$script)) {
 			$retval = execute($cmd, $quiet);
