Merge pull request #1818 from dibdot/lxc_fix
[project/luci.git] / modules / luci-base / src / mkversion.sh
1 #!/bin/sh
2
3 cat <<EOF > $1
4 local pcall, dofile, _G = pcall, dofile, _G
5
6 module "luci.version"
7
8 if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
9         distname    = ""
10         distversion = _G.DISTRIB_DESCRIPTION
11         if _G.DISTRIB_REVISION then
12                 distrevision = _G.DISTRIB_REVISION
13                 if not distversion:find(distrevision,1,true) then
14                         distversion = distversion .. " " .. distrevision
15                 end
16         end
17 else
18         distname    = "OpenWrt"
19         distversion = "Development Snapshot"
20 end
21
22 luciname    = "${3:-LuCI}"
23 luciversion = "${2:-Git}"
24 EOF