Browse Source

ffho-config-mode-site-select: Get rid of stupid sysupgrade.conf foo

Karsten Böddeker 8 years ago
parent
commit
49eb309764

+ 0 - 16
ffho/ffho-config-mode-site-select/files/lib/gluon/upgrade/002-set-site-config

@@ -8,9 +8,6 @@ local config = require 'gluon.sites'
 
 local currentsite = c:get("currentsite", "current", "name")
 
-local file = "/etc/sysupgrade.conf"
-local configured = false
-
 function serialize (f,o,d)
   if type(o) == "number" then
     f:write(o)
@@ -34,19 +31,6 @@ function serialize (f,o,d)
   end
 end
 
-
-for line in io.lines(file) do
-  if line == "/etc/config/currentsite" then
-    configured = true
-  end
-end
-
-if configured == false then
-  f = io.open(file,"a")
-  f:write("/etc/config/currentsite\n")
-  f:close()
-end
-
 if site.site_code ~= currentsite then
   if type(config[currentsite]) == "table" then
     local new = {}

+ 3 - 0
ffho/ffho-config-mode-site-select/files/lib/gluon/upgrade/999-remove-sysupgrade-currentsite

@@ -0,0 +1,3 @@
+#!/bin/sh
+cat /etc/sysupgrade.conf | grep -v /etc/config/currentsite > /tmp/sysupgrade.conf
+mv /tmp/sysupgrade.conf /etc/sysupgrade.conf