| Line 2035... |
Line 2035... |
| 2035 |
Verbose ("AddInitScript: $script, " . ($start || 'No Start') . ", " . ($stop || 'No Stop'));
|
2035 |
Verbose ("AddInitScript: $script, " . ($start || 'No Start') . ", " . ($stop || 'No Stop'));
|
| 2036 |
$script = ResolveFile($from_package, $script );
|
2036 |
$script = ResolveFile($from_package, $script );
|
| 2037 |
Message ("basedir: $basedir");
|
2037 |
Message ("basedir: $basedir");
|
| 2038 |
my $tdir = $basedir . "/etc/init.d/init.d";
|
2038 |
my $tdir = $basedir . "/etc/init.d/init.d";
|
| 2039 |
if ( $opt_platform eq 'SK100' ) {
|
2039 |
if ( $opt_platform eq 'SK100' ) {
|
| 2040 |
$tdir = $basedir . "/etc/init.d/init.vix.d/";
|
2040 |
$tdir = $basedir . "/etc/init.d/init.vix.d";
|
| 2041 |
}
|
2041 |
}
|
| 2042 |
my $base = StripDir($script);
|
2042 |
my $base = StripDir($script);
|
| 2043 |
|
2043 |
|
| 2044 |
CopyFile( $script, $tdir ) unless $no_copy;
|
2044 |
CopyFile( $script, $tdir ) unless $no_copy;
|
| 2045 |
|
2045 |
|
| Line 2076... |
Line 2076... |
| 2076 |
my $service_file = "$base" . ".service";
|
2076 |
my $service_file = "$base" . ".service";
|
| 2077 |
Message ("creating service file for SK100: $service_file in $basedir");
|
2077 |
Message ("creating service file for SK100: $service_file in $basedir");
|
| 2078 |
unless (open FILE,'>'.$service_file) {
|
2078 |
unless (open FILE,'>'.$service_file) {
|
| 2079 |
Error ("Failed to create Service file for SK100");
|
2079 |
Error ("Failed to create Service file for SK100");
|
| 2080 |
}
|
2080 |
}
|
| 2081 |
|
- |
|
| 2082 |
print FILE "#!/bin/sh\\n\\n# $base service file\n\n";
|
2081 |
print FILE "#!/bin/sh\\n\\n# $base service file\n\n";
|
| 2083 |
print FILE "start() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base start\n}\n";
|
2082 |
print FILE "start() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base start\n}\n";
|
| 2084 |
print FILE "stop() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base stop\n}\n";
|
2083 |
print FILE "stop() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base stop\n}\n";
|
| 2085 |
print FILE "restart() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base restart\n}\n";
|
2084 |
print FILE "restart() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base restart\n}\n";
|
| 2086 |
print FILE "suspend() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base suspend\n}\n";
|
2085 |
print FILE "suspend() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base suspend\n}\n";
|
| 2087 |
print FILE "resume() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base resume\n}\n";
|
2086 |
print FILE "resume() {\n [ -e /etc/init.d/init.vix.d/$base ] && /etc/init.d/init.vix.d/$base resume\n}\n";
|
| 2088 |
close FILE;
|
2087 |
close FILE;
|
| 2089 |
CopyFile($service_file, "/etc/init.d/rc.local.d", "$base");
|
2088 |
CopyFile($service_file, "/etc/init.d/rc.local.d", "$base");
|
| - |
|
2089 |
SetFilePerms('a+rx', "/etc/init.d/rc.local.d/$base");
|
| 2090 |
}
|
2090 |
}
|
| 2091 |
}
|
2091 |
}
|
| 2092 |
|
2092 |
|
| 2093 |
#-------------------------------------------------------------------------------
|
2093 |
#-------------------------------------------------------------------------------
|
| 2094 |
# Function : CatFile
|
2094 |
# Function : CatFile
|