lang: Cleanup language install scripts
parent
f428bc449e
commit
489c69a5d4
@ -1,27 +1,36 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
DIR_PATCH=/etc/crontabs/patches
|
DIR_PATCH=/etc/crontabs/patches
|
||||||
|
DIR_BACKUP=$DIR_PATCH/lang_backup
|
||||||
|
|
||||||
if [ "$(mount| grep '/usr/lib/lua/luci')" != "" ]; then
|
if [ -d $DIR_BACKUP ]; then
|
||||||
umount -l /usr/lib/lua/luci
|
if [ -f $DIR_BACKUP/fw_stable ]; then
|
||||||
|
sed -i "s/option CHANNEL 'release'/option CHANNEL 'stable'/g" /usr/share/xiaoqiang/xiaoqiang_version
|
||||||
|
fi
|
||||||
|
if [ -f $DIR_BACKUP/main_lang ]; then
|
||||||
|
MAIN_LANG=`cat $DIR_BACKUP/main_lang`
|
||||||
|
uci set luci.main.lang="$MAIN_LANG"
|
||||||
|
uci commit luci
|
||||||
|
fi
|
||||||
|
cp -f $DIR_BACKUP/base.*.lmo /usr/lib/lua/luci/i18n/
|
||||||
|
cp -f $DIR_BACKUP/sysinfo.htm /usr/lib/lua/luci/view/web/inc/
|
||||||
fi
|
fi
|
||||||
rm -rf /tmp/_usr_lib_lua_luci
|
|
||||||
|
|
||||||
if [ "$(mount| grep '/usr/share/xiaoqiang')" != "" ]; then
|
if grep -q '/lang_patch.sh' /etc/crontabs/root ; then
|
||||||
umount -l /usr/share/xiaoqiang
|
# remove older version of patch
|
||||||
|
grep -v "/lang_patch.sh" /etc/crontabs/root > /etc/crontabs/root.new
|
||||||
|
mv /etc/crontabs/root.new /etc/crontabs/root
|
||||||
|
/etc/init.d/cron restart
|
||||||
fi
|
fi
|
||||||
rm -rf /tmp/_usr_share_xiaoqiang
|
uci delete firewall.auto_lang_patch
|
||||||
|
uci commit firewall
|
||||||
|
|
||||||
grep -v "/lang_patch.sh" /etc/crontabs/root > /etc/crontabs/root.new
|
rm -rf $DIR_BACKUP
|
||||||
mv /etc/crontabs/root.new /etc/crontabs/root
|
|
||||||
/etc/init.d/cron restart
|
|
||||||
|
|
||||||
rm -f /etc/rc.lang
|
|
||||||
rm -f /etc/lang_patch.sh
|
|
||||||
rm -f $DIR_PATCH/lang_patch.sh
|
rm -f $DIR_PATCH/lang_patch.sh
|
||||||
rm -f $DIR_PATCH/lang_patch1.sh
|
|
||||||
rm -f $DIR_PATCH/base.*.lmo
|
rm -f $DIR_PATCH/base.*.lmo
|
||||||
rm -f /tmp/lang_patch.log
|
rm -f /tmp/lang_patch.log
|
||||||
|
|
||||||
luci-reload & rm -f /tmp/luci-indexcache & luci-reload
|
luci-reload
|
||||||
|
rm -f /tmp/luci-indexcache
|
||||||
|
luci-reload
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue