From 16042ec8b44346d66ae0cbdfc4a52df7339185e7 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 18 Apr 2012 16:00:45 +0200 Subject: [PATCH] script for running wpkg on shutdown --- createlinks | 2 ++ ipasserelle-gp.spec | 4 +-- .../shares/tools/files/scripts/conf.bat/10All | 1 + .../shares/wpkg/files/settings/wpkg/wpkg.bat/10All | 34 ++++++++++++++++++++++ .../files/settings/wpkg/wpkg.bat/template-begin | 0 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/10All create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/template-begin diff --git a/createlinks b/createlinks index 7b334cf..3337e28 100644 --- a/createlinks +++ b/createlinks @@ -14,3 +14,5 @@ templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory/fusioninventory_x64.reg", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg", qw(wpkg-update bootstrap-console-save)); +templates2events("/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat", qw(wpkg-update bootstrap-console-save)); + diff --git a/ipasserelle-gp.spec b/ipasserelle-gp.spec index 9b0a571..8fa6669 100644 --- a/ipasserelle-gp.spec +++ b/ipasserelle-gp.spec @@ -1,5 +1,5 @@ %define version 0.0.1 -%define release 1.beta19 +%define release 1.beta20 %define name ipasserelle-gp @@ -32,7 +32,7 @@ Basé sur WPKG et d'autres outils %build perl createlinks -%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp,tightvnc} +%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp,tightvnc,wpkg} %{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/{packages,softwares} %install diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/tools/files/scripts/conf.bat/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/tools/files/scripts/conf.bat/10All index da6836a..d7ef975 100644 --- a/root/etc/e-smith/templates/home/e-smith/files/shares/tools/files/scripts/conf.bat/10All +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/tools/files/scripts/conf.bat/10All @@ -18,6 +18,7 @@ SET IPASSERELLE_HOME_URL=$url SET COMPANY=$comp SET SOFTWARE=\\\\%IPASSERELLE_IP%\\wpkg\\softwares SET SETTINGS=\\\\%IPASSERELLE_IP%\\wpkg\\settings +SET WPKGLOGS=\\\\%IPASSERELLE_IP%\\wpkglogs EOF diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/10All new file mode 100644 index 0000000..8069061 --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/10All @@ -0,0 +1,34 @@ +{ + +my $ip = $InternalInterface{'IPAddress'}; +my $nt = $smb{'Workgrpup'}; +my $pass = $wpkg{'UserPassword'}; + +my $out .=<<"EOF"; + +@echo off +cls +echo. +echo. _________________________________________________________ +echo i\ _______________________________________________________\ +echo. i i i +echo i i Mises a jour en cours. N'eteignez pas l'ordinateur i +echo. i i i +echo i i Il s'eteindra lui-meme a la fin des operations i +echo. i i i +echo \i________________________________________________________i +echo. +echo. +net use \\\\$ip\\wpkg /user:$nt\\deploiement $pass >NUL +net use \\\\$ip\\wpkglogs /user:$nt\deploiement $pass >NUL +set SOFTWARE=\\\\$ip\\wpkg\\softwares +set SETTINGS=\\\\$ip\\wpkg\\settings +set WPKGLOGS=\\\\$ip\\wpkglogs +cscript //Nologo \\\\$ip\\wpkg\\wpkg.js /synchronize /nonotify /quiet + +EOF + +$out =~ s/\n/\r\n/g; +$OUT = $out; + +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/template-begin b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/wpkg/wpkg.bat/template-begin new file mode 100644 index 0000000..e69de29