* [PATCH] monit: Modified default install/uninstall script
@ 2021-08-01 15:45 Matthias Fischer
2021-08-04 14:19 ` Michael Tremer
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Fischer @ 2021-08-01 15:45 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 7145 bytes --]
This is a proposed patch, altering the install and uninstall script for 'monit'.
It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries
can be seen through the web gui under "System Logs".
Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
---
src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++
src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++
src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++
3 files changed, 90 insertions(+)
create mode 100644 src/paks/monit/install.sh
create mode 100644 src/paks/monit/uninstall.sh
create mode 100644 src/paks/monit/update.sh
diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh
new file mode 100644
index 000000000..8a2823ba5
--- /dev/null
+++ b/src/paks/monit/install.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+############################################################################
+# #
+# This file is part of the IPFire Firewall. #
+# #
+# IPFire is free software; you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation; either version 2 of the License, or #
+# (at your option) any later version. #
+# #
+# IPFire is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with IPFire; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+# #
+# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
+# #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_files
+restore_backup ${NAME}
+
+# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries
+sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit\[.*\]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
+sed -i "/.*'kernel' => \"\$Lang::tr{'kernel'}\",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
+
+start_service --background ${NAME}
diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh
new file mode 100644
index 000000000..8431d4a39
--- /dev/null
+++ b/src/paks/monit/uninstall.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+############################################################################
+# #
+# This file is part of the IPFire Firewall. #
+# #
+# IPFire is free software; you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation; either version 2 of the License, or #
+# (at your option) any later version. #
+# #
+# IPFire is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with IPFire; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+# #
+# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
+# #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+stop_service ${NAME}
+make_backup ${NAME}
+
+# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat'
+sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
+
+remove_files
diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh
new file mode 100644
index 000000000..99776659c
--- /dev/null
+++ b/src/paks/monit/update.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+############################################################################
+# #
+# This file is part of the IPFire Firewall. #
+# #
+# IPFire is free software; you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation; either version 2 of the License, or #
+# (at your option) any later version. #
+# #
+# IPFire is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with IPFire; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+# #
+# Copyright (C) 2007-2020 IPFire-Team <info(a)ipfire.org>. #
+# #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_backup_includes
+./uninstall.sh
+./install.sh
--
2.18.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] monit: Modified default install/uninstall script
2021-08-01 15:45 [PATCH] monit: Modified default install/uninstall script Matthias Fischer
@ 2021-08-04 14:19 ` Michael Tremer
2021-08-04 17:05 ` Matthias Fischer
0 siblings, 1 reply; 5+ messages in thread
From: Michael Tremer @ 2021-08-04 14:19 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 7735 bytes --]
Hello,
> On 1 Aug 2021, at 17:45, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>
> This is a proposed patch, altering the install and uninstall script for 'monit'.
>
> It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries
> can be seen through the web gui under "System Logs".
>
> Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
Yes, I believe it is a bit rough.
Why wouldn’t we add the monit entry to the CGI file as usual?
It is a bit ugly if there are plenty of entries for add-ons, but I suppose that is better than patching the file like this.
-Michael
> Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
> ---
> src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++
> src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++
> src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++
> 3 files changed, 90 insertions(+)
> create mode 100644 src/paks/monit/install.sh
> create mode 100644 src/paks/monit/uninstall.sh
> create mode 100644 src/paks/monit/update.sh
>
> diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh
> new file mode 100644
> index 000000000..8a2823ba5
> --- /dev/null
> +++ b/src/paks/monit/install.sh
> @@ -0,0 +1,32 @@
> +#!/bin/bash
> +############################################################################
> +# #
> +# This file is part of the IPFire Firewall. #
> +# #
> +# IPFire is free software; you can redistribute it and/or modify #
> +# it under the terms of the GNU General Public License as published by #
> +# the Free Software Foundation; either version 2 of the License, or #
> +# (at your option) any later version. #
> +# #
> +# IPFire is distributed in the hope that it will be useful, #
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
> +# GNU General Public License for more details. #
> +# #
> +# You should have received a copy of the GNU General Public License #
> +# along with IPFire; if not, write to the Free Software #
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
> +# #
> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
> +# #
> +############################################################################
> +#
> +. /opt/pakfire/lib/functions.sh
> +extract_files
> +restore_backup ${NAME}
> +
> +# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries
> +sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit\[.*\]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
> +sed -i "/.*'kernel' => \"\$Lang::tr{'kernel'}\",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
> +
> +start_service --background ${NAME}
> diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh
> new file mode 100644
> index 000000000..8431d4a39
> --- /dev/null
> +++ b/src/paks/monit/uninstall.sh
> @@ -0,0 +1,31 @@
> +#!/bin/bash
> +############################################################################
> +# #
> +# This file is part of the IPFire Firewall. #
> +# #
> +# IPFire is free software; you can redistribute it and/or modify #
> +# it under the terms of the GNU General Public License as published by #
> +# the Free Software Foundation; either version 2 of the License, or #
> +# (at your option) any later version. #
> +# #
> +# IPFire is distributed in the hope that it will be useful, #
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
> +# GNU General Public License for more details. #
> +# #
> +# You should have received a copy of the GNU General Public License #
> +# along with IPFire; if not, write to the Free Software #
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
> +# #
> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
> +# #
> +############################################################################
> +#
> +. /opt/pakfire/lib/functions.sh
> +stop_service ${NAME}
> +make_backup ${NAME}
> +
> +# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat'
> +sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
> +
> +remove_files
> diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh
> new file mode 100644
> index 000000000..99776659c
> --- /dev/null
> +++ b/src/paks/monit/update.sh
> @@ -0,0 +1,27 @@
> +#!/bin/bash
> +############################################################################
> +# #
> +# This file is part of the IPFire Firewall. #
> +# #
> +# IPFire is free software; you can redistribute it and/or modify #
> +# it under the terms of the GNU General Public License as published by #
> +# the Free Software Foundation; either version 2 of the License, or #
> +# (at your option) any later version. #
> +# #
> +# IPFire is distributed in the hope that it will be useful, #
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
> +# GNU General Public License for more details. #
> +# #
> +# You should have received a copy of the GNU General Public License #
> +# along with IPFire; if not, write to the Free Software #
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
> +# #
> +# Copyright (C) 2007-2020 IPFire-Team <info(a)ipfire.org>. #
> +# #
> +############################################################################
> +#
> +. /opt/pakfire/lib/functions.sh
> +extract_backup_includes
> +./uninstall.sh
> +./install.sh
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] monit: Modified default install/uninstall script
2021-08-04 14:19 ` Michael Tremer
@ 2021-08-04 17:05 ` Matthias Fischer
2021-08-05 9:23 ` Michael Tremer
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Fischer @ 2021-08-04 17:05 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 8079 bytes --]
On 04.08.2021 16:19, Michael Tremer wrote:
> Hello,
>
>> On 1 Aug 2021, at 17:45, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>>
>> This is a proposed patch, altering the install and uninstall script for 'monit'.
>>
>> It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries
>> can be seen through the web gui under "System Logs".
>>
>> Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
>
> Yes, I believe it is a bit rough.
As I thought... ;-)
> Why wouldn’t we add the monit entry to the CGI file as usual?
There is no CGI file... ;-)
> It is a bit ugly if there are plenty of entries for add-ons, but I suppose that is better than patching the file like this.
Thats why I added a 'sed' string for uninstalling. Had no better idea yet.
Best,
Matthias
> -Michael
>
>> Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
>> ---
>> src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++
>> src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++
>> src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++
>> 3 files changed, 90 insertions(+)
>> create mode 100644 src/paks/monit/install.sh
>> create mode 100644 src/paks/monit/uninstall.sh
>> create mode 100644 src/paks/monit/update.sh
>>
>> diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh
>> new file mode 100644
>> index 000000000..8a2823ba5
>> --- /dev/null
>> +++ b/src/paks/monit/install.sh
>> @@ -0,0 +1,32 @@
>> +#!/bin/bash
>> +############################################################################
>> +# #
>> +# This file is part of the IPFire Firewall. #
>> +# #
>> +# IPFire is free software; you can redistribute it and/or modify #
>> +# it under the terms of the GNU General Public License as published by #
>> +# the Free Software Foundation; either version 2 of the License, or #
>> +# (at your option) any later version. #
>> +# #
>> +# IPFire is distributed in the hope that it will be useful, #
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>> +# GNU General Public License for more details. #
>> +# #
>> +# You should have received a copy of the GNU General Public License #
>> +# along with IPFire; if not, write to the Free Software #
>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>> +# #
>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>> +# #
>> +############################################################################
>> +#
>> +. /opt/pakfire/lib/functions.sh
>> +extract_files
>> +restore_backup ${NAME}
>> +
>> +# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries
>> +sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit\[.*\]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>> +sed -i "/.*'kernel' => \"\$Lang::tr{'kernel'}\",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>> +
>> +start_service --background ${NAME}
>> diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh
>> new file mode 100644
>> index 000000000..8431d4a39
>> --- /dev/null
>> +++ b/src/paks/monit/uninstall.sh
>> @@ -0,0 +1,31 @@
>> +#!/bin/bash
>> +############################################################################
>> +# #
>> +# This file is part of the IPFire Firewall. #
>> +# #
>> +# IPFire is free software; you can redistribute it and/or modify #
>> +# it under the terms of the GNU General Public License as published by #
>> +# the Free Software Foundation; either version 2 of the License, or #
>> +# (at your option) any later version. #
>> +# #
>> +# IPFire is distributed in the hope that it will be useful, #
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>> +# GNU General Public License for more details. #
>> +# #
>> +# You should have received a copy of the GNU General Public License #
>> +# along with IPFire; if not, write to the Free Software #
>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>> +# #
>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>> +# #
>> +############################################################################
>> +#
>> +. /opt/pakfire/lib/functions.sh
>> +stop_service ${NAME}
>> +make_backup ${NAME}
>> +
>> +# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat'
>> +sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>> +
>> +remove_files
>> diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh
>> new file mode 100644
>> index 000000000..99776659c
>> --- /dev/null
>> +++ b/src/paks/monit/update.sh
>> @@ -0,0 +1,27 @@
>> +#!/bin/bash
>> +############################################################################
>> +# #
>> +# This file is part of the IPFire Firewall. #
>> +# #
>> +# IPFire is free software; you can redistribute it and/or modify #
>> +# it under the terms of the GNU General Public License as published by #
>> +# the Free Software Foundation; either version 2 of the License, or #
>> +# (at your option) any later version. #
>> +# #
>> +# IPFire is distributed in the hope that it will be useful, #
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>> +# GNU General Public License for more details. #
>> +# #
>> +# You should have received a copy of the GNU General Public License #
>> +# along with IPFire; if not, write to the Free Software #
>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>> +# #
>> +# Copyright (C) 2007-2020 IPFire-Team <info(a)ipfire.org>. #
>> +# #
>> +############################################################################
>> +#
>> +. /opt/pakfire/lib/functions.sh
>> +extract_backup_includes
>> +./uninstall.sh
>> +./install.sh
>> --
>> 2.18.0
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] monit: Modified default install/uninstall script
2021-08-04 17:05 ` Matthias Fischer
@ 2021-08-05 9:23 ` Michael Tremer
2021-08-05 16:58 ` Matthias Fischer
0 siblings, 1 reply; 5+ messages in thread
From: Michael Tremer @ 2021-08-05 9:23 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 8476 bytes --]
> On 4 Aug 2021, at 19:05, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>
> On 04.08.2021 16:19, Michael Tremer wrote:
>> Hello,
>>
>>> On 1 Aug 2021, at 17:45, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>>>
>>> This is a proposed patch, altering the install and uninstall script for 'monit'.
>>>
>>> It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries
>>> can be seen through the web gui under "System Logs".
>>>
>>> Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
>>
>> Yes, I believe it is a bit rough.
>
> As I thought... ;-)
>
>> Why wouldn’t we add the monit entry to the CGI file as usual?
>
> There is no CGI file... ;-)
log.dat is a CGI file with just a funny name.
>> It is a bit ugly if there are plenty of entries for add-ons, but I suppose that is better than patching the file like this.
>
> Thats why I added a 'sed' string for uninstalling. Had no better idea yet.
This would remove anything that matches. It isn’t guaranteed that the file is correct.
> Best,
> Matthias
>
>> -Michael
>>
>>> Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
>>> ---
>>> src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++
>>> src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++
>>> src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++
>>> 3 files changed, 90 insertions(+)
>>> create mode 100644 src/paks/monit/install.sh
>>> create mode 100644 src/paks/monit/uninstall.sh
>>> create mode 100644 src/paks/monit/update.sh
>>>
>>> diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh
>>> new file mode 100644
>>> index 000000000..8a2823ba5
>>> --- /dev/null
>>> +++ b/src/paks/monit/install.sh
>>> @@ -0,0 +1,32 @@
>>> +#!/bin/bash
>>> +############################################################################
>>> +# #
>>> +# This file is part of the IPFire Firewall. #
>>> +# #
>>> +# IPFire is free software; you can redistribute it and/or modify #
>>> +# it under the terms of the GNU General Public License as published by #
>>> +# the Free Software Foundation; either version 2 of the License, or #
>>> +# (at your option) any later version. #
>>> +# #
>>> +# IPFire is distributed in the hope that it will be useful, #
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>> +# GNU General Public License for more details. #
>>> +# #
>>> +# You should have received a copy of the GNU General Public License #
>>> +# along with IPFire; if not, write to the Free Software #
>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>> +# #
>>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>>> +# #
>>> +############################################################################
>>> +#
>>> +. /opt/pakfire/lib/functions.sh
>>> +extract_files
>>> +restore_backup ${NAME}
>>> +
>>> +# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries
>>> +sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit\[.*\]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>> +sed -i "/.*'kernel' => \"\$Lang::tr{'kernel'}\",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>> +
>>> +start_service --background ${NAME}
>>> diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh
>>> new file mode 100644
>>> index 000000000..8431d4a39
>>> --- /dev/null
>>> +++ b/src/paks/monit/uninstall.sh
>>> @@ -0,0 +1,31 @@
>>> +#!/bin/bash
>>> +############################################################################
>>> +# #
>>> +# This file is part of the IPFire Firewall. #
>>> +# #
>>> +# IPFire is free software; you can redistribute it and/or modify #
>>> +# it under the terms of the GNU General Public License as published by #
>>> +# the Free Software Foundation; either version 2 of the License, or #
>>> +# (at your option) any later version. #
>>> +# #
>>> +# IPFire is distributed in the hope that it will be useful, #
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>> +# GNU General Public License for more details. #
>>> +# #
>>> +# You should have received a copy of the GNU General Public License #
>>> +# along with IPFire; if not, write to the Free Software #
>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>> +# #
>>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>>> +# #
>>> +############################################################################
>>> +#
>>> +. /opt/pakfire/lib/functions.sh
>>> +stop_service ${NAME}
>>> +make_backup ${NAME}
>>> +
>>> +# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat'
>>> +sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>> +
>>> +remove_files
>>> diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh
>>> new file mode 100644
>>> index 000000000..99776659c
>>> --- /dev/null
>>> +++ b/src/paks/monit/update.sh
>>> @@ -0,0 +1,27 @@
>>> +#!/bin/bash
>>> +############################################################################
>>> +# #
>>> +# This file is part of the IPFire Firewall. #
>>> +# #
>>> +# IPFire is free software; you can redistribute it and/or modify #
>>> +# it under the terms of the GNU General Public License as published by #
>>> +# the Free Software Foundation; either version 2 of the License, or #
>>> +# (at your option) any later version. #
>>> +# #
>>> +# IPFire is distributed in the hope that it will be useful, #
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>> +# GNU General Public License for more details. #
>>> +# #
>>> +# You should have received a copy of the GNU General Public License #
>>> +# along with IPFire; if not, write to the Free Software #
>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>> +# #
>>> +# Copyright (C) 2007-2020 IPFire-Team <info(a)ipfire.org>. #
>>> +# #
>>> +############################################################################
>>> +#
>>> +. /opt/pakfire/lib/functions.sh
>>> +extract_backup_includes
>>> +./uninstall.sh
>>> +./install.sh
>>> --
>>> 2.18.0
>>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] monit: Modified default install/uninstall script
2021-08-05 9:23 ` Michael Tremer
@ 2021-08-05 16:58 ` Matthias Fischer
0 siblings, 0 replies; 5+ messages in thread
From: Matthias Fischer @ 2021-08-05 16:58 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 9115 bytes --]
Hi,
On 05.08.2021 11:23, Michael Tremer wrote:
>
>
>> On 4 Aug 2021, at 19:05, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>>
>> On 04.08.2021 16:19, Michael Tremer wrote:
>>> Hello,
>>>
>>>> On 1 Aug 2021, at 17:45, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>>>>
>>>> This is a proposed patch, altering the install and uninstall script for 'monit'.
>>>>
>>>> It alters '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat', so that all 'monit' log entries
>>>> can be seen through the web gui under "System Logs".
>>>>
>>>> Perhaps a bit rough, if someone has a better/easier solution, feel free to jump in.
>>>
>>> Yes, I believe it is a bit rough.
>>
>> As I thought... ;-)
>>
>>> Why wouldn’t we add the monit entry to the CGI file as usual?
>>
>> There is no CGI file... ;-)
>
> log.dat is a CGI file with just a funny name.
Yep. I realized this about two minutes after answering... ;-)
I'll make it that way.
>>> It is a bit ugly if there are plenty of entries for add-ons, but I suppose that is better than patching the file like this.
>>
>> Thats why I added a 'sed' string for uninstalling. Had no better idea yet.
>
> This would remove anything that matches. It isn’t guaranteed that the file is correct.
I thought that searching for the 'monit' string would avoid any
inconveniences. There is nothing else that matches. Yet.
But it's no problem for me - I can add the 'monit' strings to 'log.dat'.
I just need some time, we had a lot of water around here these days,
infrastructure is "on its knees" and days are short...
>> Best,
>> Matthias
>>
>>> -Michael
>>>
>>>> Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
>>>> ---
>>>> src/paks/monit/install.sh | 32 ++++++++++++++++++++++++++++++++
>>>> src/paks/monit/uninstall.sh | 31 +++++++++++++++++++++++++++++++
>>>> src/paks/monit/update.sh | 27 +++++++++++++++++++++++++++
>>>> 3 files changed, 90 insertions(+)
>>>> create mode 100644 src/paks/monit/install.sh
>>>> create mode 100644 src/paks/monit/uninstall.sh
>>>> create mode 100644 src/paks/monit/update.sh
>>>>
>>>> diff --git a/src/paks/monit/install.sh b/src/paks/monit/install.sh
>>>> new file mode 100644
>>>> index 000000000..8a2823ba5
>>>> --- /dev/null
>>>> +++ b/src/paks/monit/install.sh
>>>> @@ -0,0 +1,32 @@
>>>> +#!/bin/bash
>>>> +############################################################################
>>>> +# #
>>>> +# This file is part of the IPFire Firewall. #
>>>> +# #
>>>> +# IPFire is free software; you can redistribute it and/or modify #
>>>> +# it under the terms of the GNU General Public License as published by #
>>>> +# the Free Software Foundation; either version 2 of the License, or #
>>>> +# (at your option) any later version. #
>>>> +# #
>>>> +# IPFire is distributed in the hope that it will be useful, #
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>>> +# GNU General Public License for more details. #
>>>> +# #
>>>> +# You should have received a copy of the GNU General Public License #
>>>> +# along with IPFire; if not, write to the Free Software #
>>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>>> +# #
>>>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>>>> +# #
>>>> +############################################################################
>>>> +#
>>>> +. /opt/pakfire/lib/functions.sh
>>>> +extract_files
>>>> +restore_backup ${NAME}
>>>> +
>>>> +# Patch '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat' to show monit entries
>>>> +sed -i "/.*'kernel' => '(kernel: (?!DROP_))',/a \ 'monit' => '(monit\[.*\]: )'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>>> +sed -i "/.*'kernel' => \"\$Lang::tr{'kernel'}\",/a \ 'monit' => 'Monit'," /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>>> +
>>>> +start_service --background ${NAME}
>>>> diff --git a/src/paks/monit/uninstall.sh b/src/paks/monit/uninstall.sh
>>>> new file mode 100644
>>>> index 000000000..8431d4a39
>>>> --- /dev/null
>>>> +++ b/src/paks/monit/uninstall.sh
>>>> @@ -0,0 +1,31 @@
>>>> +#!/bin/bash
>>>> +############################################################################
>>>> +# #
>>>> +# This file is part of the IPFire Firewall. #
>>>> +# #
>>>> +# IPFire is free software; you can redistribute it and/or modify #
>>>> +# it under the terms of the GNU General Public License as published by #
>>>> +# the Free Software Foundation; either version 2 of the License, or #
>>>> +# (at your option) any later version. #
>>>> +# #
>>>> +# IPFire is distributed in the hope that it will be useful, #
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>>> +# GNU General Public License for more details. #
>>>> +# #
>>>> +# You should have received a copy of the GNU General Public License #
>>>> +# along with IPFire; if not, write to the Free Software #
>>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>>> +# #
>>>> +# Copyright (C) 2007 IPFire-Team <info(a)ipfire.org>. #
>>>> +# #
>>>> +############################################################################
>>>> +#
>>>> +. /opt/pakfire/lib/functions.sh
>>>> +stop_service ${NAME}
>>>> +make_backup ${NAME}
>>>> +
>>>> +# Remove monit entries from '/srv/web/ipfire/cgi-bin/logs.cgi/log.dat'
>>>> +sed -i "/'monit'/d" /srv/web/ipfire/cgi-bin/logs.cgi/log.dat
>>>> +
>>>> +remove_files
>>>> diff --git a/src/paks/monit/update.sh b/src/paks/monit/update.sh
>>>> new file mode 100644
>>>> index 000000000..99776659c
>>>> --- /dev/null
>>>> +++ b/src/paks/monit/update.sh
>>>> @@ -0,0 +1,27 @@
>>>> +#!/bin/bash
>>>> +############################################################################
>>>> +# #
>>>> +# This file is part of the IPFire Firewall. #
>>>> +# #
>>>> +# IPFire is free software; you can redistribute it and/or modify #
>>>> +# it under the terms of the GNU General Public License as published by #
>>>> +# the Free Software Foundation; either version 2 of the License, or #
>>>> +# (at your option) any later version. #
>>>> +# #
>>>> +# IPFire is distributed in the hope that it will be useful, #
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of #
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
>>>> +# GNU General Public License for more details. #
>>>> +# #
>>>> +# You should have received a copy of the GNU General Public License #
>>>> +# along with IPFire; if not, write to the Free Software #
>>>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
>>>> +# #
>>>> +# Copyright (C) 2007-2020 IPFire-Team <info(a)ipfire.org>. #
>>>> +# #
>>>> +############################################################################
>>>> +#
>>>> +. /opt/pakfire/lib/functions.sh
>>>> +extract_backup_includes
>>>> +./uninstall.sh
>>>> +./install.sh
>>>> --
>>>> 2.18.0
>>>>
>>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-05 16:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-01 15:45 [PATCH] monit: Modified default install/uninstall script Matthias Fischer
2021-08-04 14:19 ` Michael Tremer
2021-08-04 17:05 ` Matthias Fischer
2021-08-05 9:23 ` Michael Tremer
2021-08-05 16:58 ` Matthias Fischer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox