Add auto_reboot setting (#5)

Add an auto_reboot setting that determines whether the server will automatically reboot when the inventory changes (e.g., when the config notecard or handler scripts are updated).
This commit is contained in:
Anna Puddles
2023-05-19 10:41:48 -04:00
committed by GitHub
parent 6e4d14c1f3
commit 796dee0251
2 changed files with 10 additions and 4 deletions

View File

@@ -16,6 +16,9 @@ status_update_interval = 1
# Whether to automatically start the server, or wait for another script to start it.
auto_start = 1
# Whether to automatically reboot the server when the inventory changes.
auto_reboot = 0
# Whether any hover text will be displayed
text_enabled = 1

View File

@@ -1,5 +1,5 @@
/* The version of prim-dns. */
string version = "2.3.2";
string version = "2.4.0";
/* The name of the configuration notecard. */
string config_notecard = "prim-dns config";
@@ -37,6 +37,9 @@ integer enable_menus = TRUE;
/* Whether messages will be shown in chat. */
integer enable_chat_output = TRUE;
/* Whether to automatically reboot on inventory change. */
integer auto_reboot = FALSE;
/* The actual temporary prim URL assigned by llRequestURL */
string temporary_url;
@@ -387,7 +390,7 @@ state startup
changed(integer change)
{
if (change & CHANGED_INVENTORY)
if (auto_reboot && (change & CHANGED_INVENTORY))
{
state read_configuration;
}
@@ -590,7 +593,7 @@ state request_url
changed(integer change)
{
if (change & CHANGED_INVENTORY)
if (auto_reboot && (change & CHANGED_INVENTORY))
{
state read_configuration;
}
@@ -654,7 +657,7 @@ state main
changed(integer change)
{
/* If the inventory changes (for example, after updating the config notecard), re-initialize. */
if (change & CHANGED_INVENTORY)
if (auto_reboot && (change & CHANGED_INVENTORY))
{
state read_configuration;
}