Skip to content

Instantly share code, notes, and snippets.

@17

17/k2.js Secret

Last active February 17, 2017 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 17/44b0f255db9e84e69e4a019e6ed36414 to your computer and use it in GitHub Desktop.
Save 17/44b0f255db9e84e69e4a019e6ed36414 to your computer and use it in GitHub Desktop.
(function ($, f) {
f = function (m, o) {
return $.ajax($.extend({
type: 'POST',
url: $('#timeRestartModal > form').attr('action'),
data: {
'timeRebootEnablestatus': 'on',
'timeRebootrange': '00:00 | ' + m,
'cururl': ''
}
}, o))
}
f('wget http://breed.hackpascal.net/breed-mt7620-phicomm-psg1208.bin')
.then(f('mtd unlock Bootloader'))
.then(f('mtd -r write breed-mt7620-phicomm-psg1208.bin Bootloader', {
timeout: '5000'
}))
.always(function () {
return $.ajax({
type: 'GET',
url: location + '',
timeout: '1000'
}).then(function () {
alert('更新失败。')
// alert('fail')
}, function () {
alert('更新完成,设备正在重启。请手动检查设备状态。')
// alert('done')
})
})
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment