Line 68: |
Line 68: |
| # Logrotate | | # Logrotate |
| event_link("sme8admin-parselog","logrotate","15"); | | event_link("sme8admin-parselog","logrotate","15"); |
| + | |
| + | ==== Example 3 : sharedfolder==== |
| + | #!/usr/bin/perl -w |
| + | |
| + | use esmith::Build::CreateLinks qw(:all); |
| + | |
| + | #-------------------------------------------------- |
| + | # functions for manager panel |
| + | #-------------------------------------------------- |
| + | my $panel = "manager"; |
| + | |
| + | panel_link("shares", $panel); |
| + | panel_link("userpanel-encfs", $panel); |
| + | |
| + | #-------------------------------------------------- |
| + | # actions for group-delete and user-delete events |
| + | #-------------------------------------------------- |
| + | |
| + | foreach my $event (qw/group-delete user-delete/) { |
| + | event_link("group-share-modify", $event, "10"); |
| + | } |
| + | |
| + | #-------------------------------------------------- |
| + | # actions for share-delete event |
| + | #-------------------------------------------------- |
| + | |
| + | $event = "share-delete"; |
| + | |
| + | event_link("share-delete", $event, "15"); |
| + | |
| + | foreach my $event (qw(share-create share-modify share-modify-files)){ |
| + | event_link("share-modify", $event, "15"); |
| + | } |
| + | |
| + | foreach my $event (qw(share-create share-modify share-delete share-modify-servers)){ |
| + | templates2events("/etc/samba/smb.conf", $event); |
| + | templates2events("/etc/httpd/conf/httpd.conf", $event); |
| + | templates2events("/etc/rsyncd.conf", $event); |
| + | templates2events("/etc/proftpd.conf", $event); |
| + | safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/smbd"); |
| + | safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
| + | safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyncd"); |
| + | safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/ftp"); |
| + | } |
| + | |
| + | #-------------------------------------------------- |
| + | # actions for group-modify event |
| + | #-------------------------------------------------- |
| + | |
| + | $event = 'group-modify'; |
| + | |
| + | templates2events("/etc/httpd/conf/httpd.conf", $event); |
| + | safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
| + | |
| + | templates2events("/etc/fstab", "post-upgrade"); |
| + | |
| + | safe_touch("root/etc/e-smith/templates/etc/smb.conf/shares/template-begin"); |
| + | |
| + | safe_touch("root/var/service/rsyncd/down"); |
| + | service_link_enhanced("rsyncd", "S95", "7"); |
| + | service_link_enhanced("rsyncd", "K05", "6"); |
| + | service_link_enhanced("rsyncd", "K05", "0"); |
| + | safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/rsyncd'); |
| + | safe_symlink("/var/service/rsyncd" , 'root/service/rsyncd'); |
| + | |
| + | templates2events("/etc/rsyncd.conf", "bootstrap-console-save"); |
| + | templates2events("/etc/rsyncd.conf", "remoteaccess-update"); |
| + | |
| [[Category:SME Server Development Framework]] | | [[Category:SME Server Development Framework]] |
| [[Category:Development Tools]] | | [[Category:Development Tools]] |
| [[Category:SME9-Development]] | | [[Category:SME9-Development]] |