forked from hummypkg/webif
move plugins, fix cron, add queue upgrade
git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3470 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
d58ebd684a
commit
0dd9641e76
@ -18,9 +18,11 @@ export tmpf=/tmp/cronf.$$
|
|||||||
|
|
||||||
crontab=$PKG_ROOT/bin/crontab
|
crontab=$PKG_ROOT/bin/crontab
|
||||||
if [ -x $crontab ]; then
|
if [ -x $crontab ]; then
|
||||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
$crontab -l | grep -v webif/lib/bin/auto \
|
||||||
|
| grep -v webif/lib/auto > $tmpf
|
||||||
cat $tmpf - << EOM | $crontab -
|
cat $tmpf - << EOM | $crontab -
|
||||||
* * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1
|
* * * * * /mod/webif/lib/auto/scan >/dev/null 2>&1
|
||||||
|
* * * * * /mod/webif/lib/auto/deq >/dev/null 2>&1
|
||||||
EOM
|
EOM
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ $PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
|
|||||||
#fi
|
#fi
|
||||||
|
|
||||||
/mod/webif/lib/bin/diskattrs
|
/mod/webif/lib/bin/diskattrs
|
||||||
|
/mod/webif/lib/auto/upgrade
|
||||||
#/mod/webif/lib/bin/resetnew
|
#/mod/webif/lib/bin/resetnew
|
||||||
|
|
||||||
# Remove hook script placed by the legacy rt3070 package which does not work
|
# Remove hook script placed by the legacy rt3070 package which does not work
|
||||||
|
@ -4,7 +4,8 @@ export tmpf=/tmp/cronf.$$
|
|||||||
|
|
||||||
crontab=$PKG_ROOT/bin/crontab
|
crontab=$PKG_ROOT/bin/crontab
|
||||||
if [ -x $crontab ]; then
|
if [ -x $crontab ]; then
|
||||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
$crontab -l | grep -v webif/lib/bin/auto \
|
||||||
|
| grep -v webif/lib/auto > $tmpf
|
||||||
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Everything is a plugin. Those bundled with the web interface are in
|
Everything is a plugin. Those bundled with the web interface are in
|
||||||
/mod/webif/lib/auto/<name> and others are in /mod/webif/plugin/<name>
|
/mod/webif/lib/auto/plugin/<name> and others are in /mod/webif/plugin/<name>
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Priorities (* - additional package)
|
Priorities (* - additional package)
|
||||||
|
@ -98,7 +98,7 @@ proc ::auto::register {plugin {priority 500}} {
|
|||||||
# Load plugins
|
# Load plugins
|
||||||
|
|
||||||
# Bundled
|
# Bundled
|
||||||
eval_plugins queue 1 "" /mod/webif/lib/auto
|
eval_plugins queue 1 "" /mod/webif/lib/auto/plugin
|
||||||
|
|
||||||
# Third party
|
# Third party
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ proc register {type fn {priority 50}} {
|
|||||||
# Load plugins
|
# Load plugins
|
||||||
|
|
||||||
# Bundled
|
# Bundled
|
||||||
eval_plugins auto 1 "" /mod/webif/lib/auto
|
eval_plugins auto 1 "" /mod/webif/lib/auto/plugin
|
||||||
|
|
||||||
# Third party
|
# Third party
|
||||||
|
|
||||||
|
11
webif/lib/auto/upgrade
Executable file
11
webif/lib/auto/upgrade
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/mod/bin/jimsh
|
||||||
|
|
||||||
|
source /mod/webif/lib/setup
|
||||||
|
require queue.class
|
||||||
|
|
||||||
|
if {[queue version] == 1} {
|
||||||
|
queue dbhandle -close
|
||||||
|
file delete /mod/etc/queue.db
|
||||||
|
queue dbhandle
|
||||||
|
}
|
||||||
|
|
@ -219,6 +219,21 @@ proc {queue size} {} {
|
|||||||
return [llength [queue runcandidates]]
|
return [llength [queue runcandidates]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc {queue version} {} {
|
||||||
|
set db [queue dbhandle]
|
||||||
|
|
||||||
|
set version 1
|
||||||
|
catch {
|
||||||
|
foreach row [$db query {
|
||||||
|
select val from config
|
||||||
|
where var = 'version'
|
||||||
|
}] {
|
||||||
|
lassign $row x version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $version
|
||||||
|
}
|
||||||
|
|
||||||
queue method update {_status {_log ""} {_retries 0} {_runtime 0}} {
|
queue method update {_status {_log ""} {_retries 0} {_runtime 0}} {
|
||||||
set db [queue dbhandle]
|
set db [queue dbhandle]
|
||||||
$db query {
|
$db query {
|
||||||
|
Loading…
Reference in New Issue
Block a user