1 |
stephdl |
1.1 |
diff -Nur e-smith-base-5.8.0.bz9631.old/root/etc/e-smith/events/actions/set-hostname e-smith-base-5.8.0.bz9631.new/root/etc/e-smith/events/actions/set-hostname |
2 |
|
|
--- e-smith-base-5.8.0.bz9631.old/root/etc/e-smith/events/actions/set-hostname 2005-11-21 05:28:05.000000000 +0100 |
3 |
|
|
+++ e-smith-base-5.8.0.bz9631.new/root/etc/e-smith/events/actions/set-hostname 2016-07-02 21:04:00.777373320 +0200 |
4 |
|
|
@@ -1,7 +1,7 @@ |
5 |
|
|
-#!/bin/sh |
6 |
|
|
+#!/usr/bin/perl |
7 |
|
|
|
8 |
|
|
#---------------------------------------------------------------------- |
9 |
|
|
-# copyright (C) 1999-2005 Mitel Networks Coporation |
10 |
|
|
+# copyright (C) 2016 Koozali SME Server |
11 |
|
|
# |
12 |
|
|
# This program is free software; you can redistribute it and/or modify |
13 |
|
|
# it under the terms of the GNU General Public License as published by |
14 |
|
|
@@ -18,5 +18,14 @@ |
15 |
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
16 |
|
|
# |
17 |
|
|
#---------------------------------------------------------------------- |
18 |
|
|
+use esmith::ConfigDB; |
19 |
|
|
|
20 |
|
|
-exec /bin/hostname -F /etc/HOSTNAME |
21 |
|
|
+my $db = esmith::ConfigDB->open_ro() or die 'cannot open the database'; |
22 |
|
|
+my $SystemName = $db->get_value('SystemName'); |
23 |
|
|
+my $DomainName = $db->get_value('DomainName'); |
24 |
|
|
+ |
25 |
|
|
+#set the command |
26 |
|
|
+my $command = "exec /bin/hostnamectl set-hostname $SystemName.$DomainName"; |
27 |
|
|
+ |
28 |
|
|
+open EXEC, "$command |" or die "cannot set hostname: $!"; |
29 |
|
|
+close EXEC; |