From 0f001da91254527623f38ee8988baf74daad2605 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Fri, 24 Jun 2016 16:48:48 -0400 Subject: [PATCH] Remove init.d files from gen_gdl90 process. --- main/gen_gdl90.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index 7d3236be..84b66287 100644 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -1208,19 +1208,28 @@ func main() { debugLogf = debugLog dataLogFilef = dataLogFile } + //FIXME: All of this should be removed by 08/01/2016. // Check if Raspbian version is <8.0. Throw a warning if so. vt, err := ioutil.ReadFile("/etc/debian_version") if err == nil { vtS := strings.Trim(string(vt), "\n") vtF, err := strconv.ParseFloat(vtS, 32) - if err == nil && vtF < 8.0 { - var err_os error - if globalStatus.HardwareBuild == "FlightBox" { - err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit https://www.openflightsolutions.com/flightbox/image-update-required for further information.") + if err == nil { + if vtF < 8.0 { + var err_os error + if globalStatus.HardwareBuild == "FlightBox" { + err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit https://www.openflightsolutions.com/flightbox/image-update-required for further information.") + } else { + err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit http://stratux.me/ to update using the latest release image.") + } + addSystemError(err_os) } else { - err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit http://stratux.me/ to update using the latest release image.") + // Running Jessie or better. Remove some old init.d files. + // This made its way in here because /etc/init.d/stratux invokes the update script, which can't delete the init.d file. + os.Remove("/etc/init.d/stratux") + os.Remove("/etc/rc2.d/S01stratux") + os.Remove("/etc/rc6.d/K01stratux") } - addSystemError(err_os) } }