mkversion.sh 535 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. cat <<EOF > $1
  3. local pcall, dofile, _G = pcall, dofile, _G
  4. module "luci.version"
  5. if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
  6. distname = ""
  7. distversion = _G.DISTRIB_DESCRIPTION
  8. if _G.DISTRIB_REVISION then
  9. distrevision = _G.DISTRIB_REVISION
  10. if not distversion:find(distrevision,1,true) then
  11. distversion = distversion .. " " .. distrevision
  12. end
  13. end
  14. else
  15. distname = "libreCMC"
  16. distversion = "Development Snapshot"
  17. end
  18. luciname = "${3:-LuCI}"
  19. luciversion = "${2:-Git}"
  20. EOF