/etc/init.d/dootask-checkin-report </tmp/cronbak sed -i '/\/etc\/init.d\/dootask-checkin-report/d' /tmp/cronbak sed -i '/^$/d' /tmp/cronbak echo "* * * * * sh /etc/init.d/dootask-checkin-report" >>/tmp/cronbak crontab /tmp/cronbak rm -f /tmp/cronbak /etc/init.d/cron enable /etc/init.d/cron restart echo 'installed' EOE; } /** * {post} 签到 - 路由器(openwrt)上报 * * @apiParam {String} key * @apiParam {String} mac 使用逗号分割多个 * @apiParam {String} time * * @return string */ public function checkin__report() { $key = trim(Request::input('key')); $mac = trim(Request::input('mac')); $time = intval(Request::input('time')); $type = trim(Request::input('type')); // $setting = Base::setting('checkinSetting'); if ($setting['open'] !== 'open') { return 'function off'; } if ($type && $type === 'face') { if (!in_array('face', $setting['modes'])) { return 'mode off'; } if ($key != $setting['face_key']) { return 'key error'; } } else { if (!in_array('auto', $setting['modes'])) { return 'mode off'; } if ($key != $setting['key']) { return 'key error'; } } if ($error = UserBot::checkinBotCheckin($mac, $time)) { return $error; } return 'success'; } }