Skip to content

Commit 4d80e0c

Browse files
committed
First release
0 parents  commit 4d80e0c

14 files changed

+117
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hashes.json
2+
_build/
3+
_releases/
4+
_data/

Listener.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Inforge\RebootNotification;
4+
5+
use function file_exists;
6+
7+
class Listener
8+
{
9+
public static function checkReboot(\XF\Admin\App $app, array &$params,
10+
\XF\Mvc\Reply\AbstractReply &$reply, \XF\Mvc\Renderer\AbstractRenderer &$renderer)
11+
{
12+
$options = \XF::options();
13+
$params['systemRebootNeeded'] =
14+
!empty($options->ifRnCheckFile)
15+
&& file_exists($options->ifRnCheckFile);
16+
}
17+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Reboot Notification
2+
3+
Xenforo 2.x addon to show a notification in the admin panel when a system
4+
reboot is required.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"app_admin_render_page_43e2765eb85dbfc62eb923d16e0898fe.json": {
3+
"hash": "055809653d9b305f1088cdc853b6185e"
4+
}
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"event_id": "app_admin_render_page",
3+
"execute_order": 100,
4+
"callback_class": "Inforge\\RebootNotification\\Listener",
5+
"callback_method": "checkReboot",
6+
"active": true,
7+
"hint": "",
8+
"description": "Check if a system reboot is needed."
9+
}

_output/options/_metadata.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ifRnCheckFile.json": {
3+
"hash": "815c60e3590c7b72710fd9ccde166efc"
4+
}
5+
}

_output/options/ifRnCheckFile.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"edit_format": "textbox",
3+
"edit_format_params": "",
4+
"data_type": "string",
5+
"sub_options": [],
6+
"validation_class": "",
7+
"validation_method": "",
8+
"advanced": true,
9+
"default_value": "/var/run/reboot-required",
10+
"relations": {
11+
"acp": 7100
12+
}
13+
}

_output/phrases/_metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"if_rn_system_reboot_is_needed_warning.txt": {
3+
"global_cache": false,
4+
"version_id": 1000070,
5+
"version_string": "1.0.0",
6+
"hash": "d0a58d658a5d61af6c2b98830b50f25e"
7+
},
8+
"option.ifRnCheckFile.txt": {
9+
"global_cache": false,
10+
"version_id": 1000070,
11+
"version_string": "1.0.0",
12+
"hash": "40d2cc9bbb45713871b680517b9220c2"
13+
},
14+
"option_explain.ifRnCheckFile.txt": {
15+
"global_cache": false,
16+
"version_id": 1000070,
17+
"version_string": "1.0.0",
18+
"hash": "9721600d15afd860e541144be6961b9f"
19+
}
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A system reboot is needed to apply some updates. Please connect to your server and run <code>shutdown -r hh:mm</code> to schedule a reboot at time <code>hh:mm</code> (or 'now' to reboot instantly).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
File to check for reboot notification

0 commit comments

Comments
 (0)