# HG changeset patch # User Kim Alvefur # Date 1686081654 -7200 # Node ID 38582771b593698d1815632ab687d682942b7d85 # Parent f45a29b32f7a4abfff9eca229b2246a7cfeb1c1c mod_admin_shell: Warn when (un-)loading module would be undone by restart Reminder to update the configuration if the change is to be permanent. diff -r f45a29b32f7a -r 38582771b593 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Sat Jun 03 21:53:20 2023 +0200 +++ b/plugins/mod_admin_shell.lua Tue Jun 06 22:00:54 2023 +0200 @@ -599,6 +599,8 @@ -- Load the module for each host local ok, err, count, mod = true, nil, 0; for host in hosts do + local configured_modules, component = modulemanager.get_modules_for_host(host); + if (not modulemanager.is_loaded(host, name)) then mod, err = modulemanager.load(host, name); if not mod then @@ -613,6 +615,10 @@ else count = count + 1; self.session.print("Loaded for "..mod.module.host); + + if not (configured_modules:contains(name) or name == component) then + self.session.print("Note: Module will not be loaded after restart unless enabled in configuration"); + end end end end @@ -626,6 +632,8 @@ -- Unload the module for each host local ok, err, count = true, nil, 0; for host in hosts do + local configured_modules, component = modulemanager.get_modules_for_host(host); + if modulemanager.is_loaded(host, name) then ok, err = modulemanager.unload(host, name); if not ok then @@ -634,6 +642,10 @@ else count = count + 1; self.session.print("Unloaded from "..host); + + if configured_modules:contains(name) or name == component then + self.session.print("Note: Module will be loaded after restart unless disabled in configuration"); + end end end end