Skip to content

Commit

Permalink
- main file now processed by automake
Browse files Browse the repository at this point in the history
- version added to help output
- upgrade from net-snmp-subagent package fixed
  • Loading branch information
sergevs committed Oct 29, 2013
1 parent 3cf8126 commit 656077a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
20 changes: 19 additions & 1 deletion RPM/SPECS/net-snmp-subagent-shell.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <[email protected]> 1.1.0.0-ssv1
-- Initial release
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AC_INIT(net-snmp-subagent-shell, 2.1.2.0, [email protected])
AM_INIT_AUTOMAKE(net-snmp-subagent-shell, 2.1.2.0)
AC_INIT(net-snmp-subagent-shell, 2.1.2.1, [email protected])
AM_INIT_AUTOMAKE
AC_PROG_INSTALL
AC_OUTPUT(Makefile)
AC_OUTPUT(subagent-shell)
2 changes: 2 additions & 0 deletions subagent-shell.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ undef $opt->{log_file} unless $opt->{log_file};

sub help {
print <<EOHELP;
Version: @VERSION@
Usage: subagent-shell [options]
Options:
Expand Down

0 comments on commit 656077a

Please sign in to comment.