home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / system-tools-backends-2.0 / scripts / SystemToolsBackends.pl < prev    next >
Encoding:
Perl Script  |  2006-08-14  |  2.3 KB  |  75 lines

  1. #!/usr/bin/env perl
  2. #-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  3.  
  4. # Loader for the system tools backends.
  5. #
  6. # Copyright (C) 2005 Carlos Garnacho
  7. #
  8. # Authors: Carlos Garnacho Parro  <carlosg@gnome.org>
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU Library General Public License as published
  12. # by the Free Software Foundation; either version 2 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. # GNU Library General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Library General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  23.  
  24. use lib "/usr/share//system-tools-backends-2.0/scripts";
  25. use lib "";
  26.  
  27. BEGIN {
  28.   my $i = 0;
  29.  
  30.   # Clean undesired entries in @INC
  31.   while ($INC[$i]) {
  32.     delete $INC[$i] if ($INC[$i] =~ /^@/);
  33.     $i++;
  34.   }
  35. }
  36.  
  37. use Net::DBus;
  38. use Net::DBus::Service;
  39. use Net::DBus::Reactor;
  40. use Utils::Backend;
  41. use Utils::Monitor;
  42. use Utils::Platform;
  43.  
  44. use SMBConfig;
  45. use NFSConfig;
  46. use UsersConfig;
  47. use GroupsConfig;
  48. use TimeConfig;
  49. use NTPConfig;
  50. use HostsConfig;
  51. use IfacesConfig;
  52. use ServicesConfig;
  53.  
  54. # Initialize tool
  55. &Utils::Backend::init ($name, $version, $description, $directives, @ARGV);
  56.  
  57. # Initialize bus
  58. my $bus = &Utils::Backend::get_bus ();
  59. my $service = $bus->export_service ($Utils::Backend::DBUS_PREFIX);
  60.  
  61. #Initialize all objects
  62. my $platforms_list  = Utils::Platform->new ($service);
  63. my $smb_config      = SMBConfig->new       ($service);
  64. my $nfs_config      = NFSConfig->new       ($service);
  65. my $users_config    = UsersConfig->new     ($service);
  66. my $groups_config   = GroupsConfig->new    ($service);
  67. my $time_config     = TimeConfig->new      ($service);
  68. my $ntp_config      = NTPConfig->new       ($service);
  69. my $hosts_config    = HostsConfig->new     ($service);
  70. my $ifaces_config   = IfacesConfig->new    ($service);
  71. my $services_config = ServicesConfig->new  ($service);
  72.  
  73. Net::DBus::Reactor->main->add_timeout (50, Net::DBus::Callback->new(method => \&Utils::Monitor::do_monitor_files));
  74. Net::DBus::Reactor->main->run ();
  75.