1 |
diff -Nur smeserver-durep-1.5.0.old/createlinks smeserver-durep-1.5.0/createlinks |
2 |
--- smeserver-durep-1.5.0.old/createlinks 2021-02-22 13:50:09.551000000 -0500 |
3 |
+++ smeserver-durep-1.5.0/createlinks 2021-02-22 14:00:59.144000000 -0500 |
4 |
@@ -2,60 +2,21 @@ |
5 |
# This script creates the symlinks needed by this RPM |
6 |
# Specific support exists to create symlinks within e-smith web "panels" |
7 |
# and for links from named "events" directories into the "actions" directory |
8 |
+use esmith::Build::CreateLinks qw(:all); |
9 |
|
10 |
-sub panel_link |
11 |
-{ |
12 |
- my ($function, $panel) = @_; |
13 |
- |
14 |
- unlink "root/etc/e-smith/web/panels/$panel/cgi-bin/$function"; |
15 |
- symlink("../../../functions/$function", |
16 |
- "root/etc/e-smith/web/panels/$panel/cgi-bin/$function") |
17 |
- or die "Can't symlink to root/etc/e-smith/web/panels/$panel". |
18 |
- "/cgi-bin/$function: $!"; |
19 |
-} |
20 |
- |
21 |
-sub safe_symlink { |
22 |
- my ($from, $to) = @_; |
23 |
- use File::Basename; |
24 |
- use File::Path; |
25 |
- mkpath(dirname($to)); |
26 |
- unlink($to); |
27 |
- symlink($from, $to) or die "Can't create symlink from $from to $to: $!"; |
28 |
-} |
29 |
- |
30 |
-sub event_link |
31 |
-{ |
32 |
- my ($action, $event, $level) = @_; |
33 |
- |
34 |
- unlink "root/etc/e-smith/events/${event}/S${level}${action}"; |
35 |
- symlink("../actions/${action}", |
36 |
- "root/etc/e-smith/events/${event}/S${level}${action}") |
37 |
- or die "Can't symlink to " . |
38 |
- "root/etc/e-smith/events/${event}/S${level}${action}: $!"; |
39 |
-} |
40 |
- |
41 |
-#-------------------------------------------------- |
42 |
-# functions for manager panel |
43 |
-#-------------------------------------------------- |
44 |
-my $panel = "manager"; |
45 |
- |
46 |
-#panel_link("function1", $panel); |
47 |
-#panel_link("function2", $panel); |
48 |
+safe_symlink("/etc/e-smith/web/functions/wrapper","root/etc/e-smith/web/panels/manager/cgi-bin/durep"); |
49 |
|
50 |
#-------------------------------------------------- |
51 |
-# actions for console-save event: |
52 |
+# actions for post-upgrade: |
53 |
#-------------------------------------------------- |
54 |
-$event = "console-save"; |
55 |
- |
56 |
-#event_link("action1", $event, "55"); |
57 |
-#event_link("action2", $event, "60"); |
58 |
+$event = "post-upgrade"; |
59 |
+event_link("durep-init", $event, "90"); |
60 |
|
61 |
#-------------------------------------------------- |
62 |
-# actions for domain-create event: |
63 |
+# actions for smeserver-durep-update: |
64 |
#-------------------------------------------------- |
65 |
-$event = "domain-create"; |
66 |
- |
67 |
-#event_link("action1", $event, "55"); |
68 |
-#event_link("action2", $event, "90"); |
69 |
+$event = "smeserver-durep-update"; |
70 |
|
71 |
-safe_symlink("/etc/e-smith/web/functions/wrapper","root/etc/e-smith/web/panels/manager/cgi-bin/durep"); |
72 |
+event_link("navigation-conf", $event, "50"); |
73 |
+event_link("durep-init", $event, "90"); |
74 |
+templates2events("/etc/crontab", $event ); |
75 |
diff -Nur smeserver-durep-1.5.0.old/root/etc/e-smith/events/actions/durep-init smeserver-durep-1.5.0/root/etc/e-smith/events/actions/durep-init |
76 |
--- smeserver-durep-1.5.0.old/root/etc/e-smith/events/actions/durep-init 1969-12-31 19:00:00.000000000 -0500 |
77 |
+++ smeserver-durep-1.5.0/root/etc/e-smith/events/actions/durep-init 2021-02-22 13:56:30.611000000 -0500 |
78 |
@@ -0,0 +1,3 @@ |
79 |
+#!/bin/bash |
80 |
+echo "Initial run of durep ... please wait." |
81 |
+/usr/sbin/durep.daily >/dev/null |