Changeset 2232


Ignore:
Timestamp:
Dec 6, 2012, 2:43:07 PM (6 years ago)
Author:
matthijs
Message:

plugin-wol: Take care to not delete / overwrite the config file.

Previously, any pre-existing config file would be overwritten on plugin
installation and it would be deleted on plugin uninstallation. Now, it
is handled as expected.

Location:
trunk/fon/plugins/plugin-wol
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/plugins/plugin-wol/Makefile

    r2229 r2232  
    1111
    1212PKG_NAME:=plugin-wol
    13 PKG_RELEASE:=1.0
     13PKG_RELEASE:=1.0.1
    1414PKG_TARGETS=fon-pkg
    1515
  • trunk/fon/plugins/plugin-wol/upgrade

    r2229 r2232  
    1919end
    2020
     21-- Manually install the config file. This makes sure that:
     22--  * The file is not overwritten if it exists already
     23--  * The file does not end up in the plugin file list and thus doesn't
     24--    get deleted when the plugin is uninstalled.
     25if not fs.isfile("/etc/config/luci_wol") then
     26        fs.copy(dir.."/files/etc/config/luci_wol", "/etc/config/luci_wol")
     27end
     28fs.unlink(dir.."/files/etc/config/luci_wol")
     29
    2130-- Install
    2231plugin:addfiles(dir.."/files/")
Note: See TracChangeset for help on using the changeset viewer.