initial commit of file from CVS for e-smith-test on Wed 12 Jul 09:10:30 BST 2023
This commit is contained in:
43
createlinks
Executable file
43
createlinks
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
|
||||
sub safe_symlink {
|
||||
my ($from, $to) = @_;
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
mkpath(dirname($to));
|
||||
unlink($to);
|
||||
symlink($from, $to) or die "Can't create symlink from $from to $to: $!";
|
||||
}
|
||||
|
||||
sub panel_link
|
||||
{
|
||||
my ($function, $panel) = @_;
|
||||
|
||||
my $cgibin = "root/etc/e-smith/web/panels/$panel/cgi-bin";
|
||||
|
||||
safe_symlink("../../../functions/$function",
|
||||
"$cgibin/$function")
|
||||
}
|
||||
|
||||
sub event_link
|
||||
{
|
||||
my ($action, $event, $level) = @_;
|
||||
|
||||
safe_symlink("../actions/${action}",
|
||||
"root/etc/e-smith/events/${event}/S${level}${action}");
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# actions for post-install event
|
||||
#--------------------------------------------------
|
||||
$event = "post-install";
|
||||
|
||||
event_link("testing-conf", $event, "90");
|
||||
|
||||
#--------------------------------------------------
|
||||
# actions for post-upgrade event
|
||||
#--------------------------------------------------
|
||||
$event = "post-upgrade";
|
||||
|
||||
event_link("testing-conf", $event, "90");
|
Reference in New Issue
Block a user