diff --git a/RPM/SPECS/net-snmp-subagent-shell.spec b/RPM/SPECS/net-snmp-subagent-shell.spec index 995fdd2..fd49fee 100644 --- a/RPM/SPECS/net-snmp-subagent-shell.spec +++ b/RPM/SPECS/net-snmp-subagent-shell.spec @@ -33,7 +33,7 @@ Net SNMP subagent executes arbitrary commands and provide results via snmpd %files %defattr(-,root,root) -%_bindir/* +%attr(755,root,root) %_bindir/* %dir /etc/snmp/subagent-shell %dir /etc/snmp/subagent-shell/mibs %dir /etc/snmp/subagent-shell/conf.d @@ -61,6 +61,24 @@ if [ $1 = 0 ] ; then fi exit 0 +# this section is required to smooth upgrade from net-snmp-subagent package +%triggerpostun -- net-snmp-subagent +if [ "$1" == "1" ]; then + if [ -d /etc/snmp/subagent ]; then + for f in `find /etc/snmp/subagent/ -maxdepth 1 -type f -name '*.rpmsave'` + do + mv $f /etc/snmp/subagent-shell/`basename $f` + done + pushd /etc/snmp/subagent >/dev/null 2>&1 + find -maxdepth 1 -type f -exec cp '{}' /etc/snmp/subagent-shell ';' + popd >/dev/null 2>&1 + rm -rf /etc/snmp/subagent + echo 'Files from /etc/snmp/subagent moved to new /etc/snmp/subagent-shell directory ...' + fi + /sbin/chkconfig --add subagent-shell || : + /sbin/service subagent-shell start >/dev/null 2>&1 || : +fi + %changelog * Wed Nov 23 2011 Serge 1.1.0.0-ssv1 -- Initial release diff --git a/configure.ac b/configure.ac index d9f7779..81c39e6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,5 @@ -AC_INIT(net-snmp-subagent-shell, 2.1.2.0, abrikus@gmail.com) -AM_INIT_AUTOMAKE(net-snmp-subagent-shell, 2.1.2.0) +AC_INIT(net-snmp-subagent-shell, 2.1.2.1, abrikus@gmail.com) +AM_INIT_AUTOMAKE AC_PROG_INSTALL AC_OUTPUT(Makefile) +AC_OUTPUT(subagent-shell) diff --git a/subagent-shell.in b/subagent-shell.in old mode 100755 new mode 100644 index d55df43..862f316 --- a/subagent-shell.in +++ b/subagent-shell.in @@ -75,6 +75,8 @@ undef $opt->{log_file} unless $opt->{log_file}; sub help { print <