Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirrors
openwrt
luci
提交
2fa0fa18
L
luci
项目概览
mirrors
/
openwrt
/
luci
大约 1 年 前同步成功
通知
43
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
luci
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fa0fa18
编写于
10月 03, 2011
作者:
M
Manuel Munz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
contrib/meshwizard: Fix setting of values which contain spaces & cleanups
上级
35137845
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
40 deletion
+31
-40
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
.../package/meshwizard/files/usr/bin/meshwizard/functions.sh
+6
-3
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh
...wizard/files/usr/bin/meshwizard/helpers/initial_config.sh
+7
-26
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
...hwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
+5
-0
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
...wizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
+3
-4
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
...shwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
+1
-0
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
...rib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
+9
-7
未找到文件。
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
浏览文件 @
2fa0fa18
...
...
@@ -24,9 +24,12 @@ uci_commitverbose() {
}
set_defaults
()
{
for
def
in
$(
env
|grep
"^
$1
"
)
;
do
option
=
${
def
/
$1
/
}
uci
set
$2
.
$option
for
def
in
$(
env
|grep
"^
$1
"
|
sed
's/ /_/g'
)
;
do
option
=
"
${
def
/
$1
/
}
"
a
=
"
$(
echo
$option
|cut
-d
'='
-f1
)
"
b
=
"
$(
echo
$option
|cut
-d
'='
-f2
)
"
b
=
"
${
b
//_/
}
"
uci
set
$2
.
$a
=
"
$b
"
done
}
...
...
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh
浏览文件 @
2fa0fa18
...
...
@@ -18,42 +18,23 @@ handle_system() {
}
config_foreach handle_system system
if
[
-n
"
$(
uci
-q
get meshwizard.system
)
"
]
;
then
echo
" + Setup system"
uci show meshwizard.system |
sed
's/^meshwizard/uci set system/g'
|
while
read
line
;
do
eval
$line
echo
"
$line
"
done
uci
-q
delete meshwizard.system
fi
if
[
-n
"
$(
uci
-q
get meshwizard.community
)
"
]
;
then
echo
" + Setup community"
uci show meshwizard.community |
sed
's/^meshwizard/freifunk/g'
|
while
read
line
;
do
eval
uci
set
$line
echo
"
$line
"
done
set_defaults
"community_"
freifunk.community
uci
-q
delete meshwizard.community
uci_commitverbose freifunk
fi
if
[
-n
"
$(
uci
-q
get meshwizard.contact
)
"
]
;
then
echo
" + Setup contact"
uci show meshwizard.contact |
sed
's/^meshwizard/freifunk/g'
|
while
read
line
;
do
eval
uci
set
$line
echo
"
$line
"
done
uci
-q
delete meshwizard.contact
set_defaults
"contact_"
freifunk.contact
uci
-q
delete meshwizard.contact
&&
uci_commitverbose freifunk
fi
if
[
"
$has_luci
"
==
TRUE
]
;
then
if
[
-n
"
$(
uci
-q
get meshwizard.luci_main
)
"
]
;
then
echo
" + Setup luci"
uci show meshwizard.luci_main |sed
-e
's/^meshwizard/luci/g'
-e
's/luci_main/main/'
|
while
read
line
;
do
eval
uci
set
$line
echo
"
$line
"
done
uci
-q
delete meshwizard.luci_main
fi
echo
" + Setup luci"
set_defaults
"luci_main_"
luci.main
uci
-q
delete meshwizard.luci_main
&&
uci_commitverbose luci
fi
uci commit
...
...
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
浏览文件 @
2fa0fa18
...
...
@@ -18,3 +18,8 @@ done
for
v
in
system wifi_device wifi_iface interface
alias
dhcp olsr_interface olsr_interfacedefaults profile zone_freifunk include
;
do
get_var profile_
$community
.
$v
done
# read values from meshwizard
for
v
in
system luci_main contact community
;
do
get_var meshwizard.
$v
done
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_freifunk.sh
浏览文件 @
2fa0fa18
...
...
@@ -4,11 +4,10 @@
.
$dir
/functions.sh
# Set community homepage
hp
=
$(
uci
-q
get profile_
$community
.profile.homepage
)
if
[
-n
"
$
hp
"
]
;
then
uci
set
freifunk.community.homepage
=
"
$
hp
"
if
[
-n
"
$
profile_homepage
"
]
;
then
uci
set
freifunk.community.homepage
=
"
$
profile_homepage
"
fi
uci_commitverbose
"/etc/init.d/freifunk config"
freifunk
uci_commitverbose freifunk
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh
浏览文件 @
2fa0fa18
...
...
@@ -9,4 +9,5 @@ if [ -n "$(env | grep '^system_')" ]; then
done
fi
uci
-q
delete meshwizard.system
&&
uci commit meshwizard
uci_commitverbose
"System config"
system
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
浏览文件 @
2fa0fa18
...
...
@@ -23,12 +23,9 @@ opkg list_installed |grep luci-app-splash > /dev/null && export has_luci_splash=
echo
"+ Renaming wifi-devices in /etc/config/meshwizard"
$dir
/helpers/rename-wifi.sh
# Firstboot/initial config
echo
"+ Initial config"
$dir
/helpers/initial_config.sh
# Get community
export
community
=
$(
uci get freifunk.community.name
)
export
community
=
$(
uci
-q
get meshwizard.community.name
)
[
-z
"
$community
"
]
&&
community
=
$(
uci
-q
get freifunk.community.name
)
[
-z
"
$community
"
]
&&
echo
"Error: Community is not set in /etc/config/freifunk, aborting now."
&&
exit
1
# Check whether we want to cleanup uci config before setting new options or not
...
...
@@ -45,15 +42,20 @@ export networks
echo
" Community=
$community
Network(s)=
$networks
"
# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community,
# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community
# then /etc/config/meshwizard
# last will overwrite first
$dir
/helpers/read_defaults.sh
$community
>
/tmp/meshwizard.tmp
while
read
line
;
do
export
"
${
line
//\
"/}"
done < /tmp/meshwizard.tmp
# Firstboot/initial config
echo
"+ Initial config"
$dir
/helpers/initial_config.sh
$dir
/helpers/setup_dnsmasq.sh
$dir
/helpers/setup_system.sh
$dir
/helpers/setup_freifunk.sh
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录