Skip to content

Commit 656077a

Browse files
committed
- main file now processed by automake
- version added to help output - upgrade from net-snmp-subagent package fixed
1 parent 3cf8126 commit 656077a

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

RPM/SPECS/net-snmp-subagent-shell.spec

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Net SNMP subagent executes arbitrary commands and provide results via snmpd
3333

3434
%files
3535
%defattr(-,root,root)
36-
%_bindir/*
36+
%attr(755,root,root) %_bindir/*
3737
%dir /etc/snmp/subagent-shell
3838
%dir /etc/snmp/subagent-shell/mibs
3939
%dir /etc/snmp/subagent-shell/conf.d
@@ -61,6 +61,24 @@ if [ $1 = 0 ] ; then
6161
fi
6262
exit 0
6363

64+
# this section is required to smooth upgrade from net-snmp-subagent package
65+
%triggerpostun -- net-snmp-subagent
66+
if [ "$1" == "1" ]; then
67+
if [ -d /etc/snmp/subagent ]; then
68+
for f in `find /etc/snmp/subagent/ -maxdepth 1 -type f -name '*.rpmsave'`
69+
do
70+
mv $f /etc/snmp/subagent-shell/`basename $f`
71+
done
72+
pushd /etc/snmp/subagent >/dev/null 2>&1
73+
find -maxdepth 1 -type f -exec cp '{}' /etc/snmp/subagent-shell ';'
74+
popd >/dev/null 2>&1
75+
rm -rf /etc/snmp/subagent
76+
echo 'Files from /etc/snmp/subagent moved to new /etc/snmp/subagent-shell directory ...'
77+
fi
78+
/sbin/chkconfig --add subagent-shell || :
79+
/sbin/service subagent-shell start >/dev/null 2>&1 || :
80+
fi
81+
6482
%changelog
6583
* Wed Nov 23 2011 Serge <abrikus@gmail.com> 1.1.0.0-ssv1
6684
-- Initial release

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
AC_INIT(net-snmp-subagent-shell, 2.1.2.0, abrikus@gmail.com)
2-
AM_INIT_AUTOMAKE(net-snmp-subagent-shell, 2.1.2.0)
1+
AC_INIT(net-snmp-subagent-shell, 2.1.2.1, abrikus@gmail.com)
2+
AM_INIT_AUTOMAKE
33
AC_PROG_INSTALL
44
AC_OUTPUT(Makefile)
5+
AC_OUTPUT(subagent-shell)

subagent-shell.in

100755100644
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ undef $opt->{log_file} unless $opt->{log_file};
7575

7676
sub help {
7777
print <<EOHELP;
78+
Version: @VERSION@
79+
7880
Usage: subagent-shell [options]
7981
8082
Options:

0 commit comments

Comments
 (0)