﻿{"id":1459,"date":"2021-01-24T17:44:22","date_gmt":"2021-01-24T09:44:22","guid":{"rendered":"https:\/\/www.tansoo.cn\/?p=1459"},"modified":"2021-01-24T17:44:22","modified_gmt":"2021-01-24T09:44:22","slug":"phpbb-48","status":"publish","type":"post","link":"https:\/\/www.tansoo.cn\/?p=1459","title":{"rendered":"OpenWrt\u8def\u7531\u5668\u6253\u5370\u670d\u52a1\u5668\u8bbe\u7f6e"},"content":{"rendered":"<p><span style=\"font-size:150%;line-height:116%\">\u4e00\u3001\u8def\u7531\u5668USB\u6253\u5370\u5171\u4eab\u8bbe\u7f6e<br \/>\n       <a href=\"https:\/\/openwrt.org\/ru\/doc\/howto\/print-server-p910nd\" class=\"postlink\">https:\/\/openwrt.org\/ru\/doc\/howto\/print-server-p910nd<\/a><br \/>\n1\u3001\u5b89\u88c5\u6253\u5370\u9a71\u52a8,HP\u9a71\u52a8\u5217\u8868http:\/\/oleg.wl500g.info\/hplj\/<\/span><\/p>\n<div class=\"codebox_plus_wrap\">\n<div class=\"codebox_plus_header\"><strong>Code: <\/strong><a href=\"#\" onclick=\"codebox_plus_select(this, 1); return false;\">[\u5168\u9009]<\/a>&nbsp;<a href=\"#\" onclick=\"codebox_plus_toggle(this, 1); return false;\">[Expand\/Collapse]<\/a><\/div>\n<div>\n<div style=\"display: inline;\">\n<div class=\"bash\" style=\"font-family:monospace;\">\n<ol>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">opkg update<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">opkg <span style=\"color: #c20cb9; font-weight: bold;\">install<\/span> kmod-usb-printer usbutils p910nd <span style=\"color: #c20cb9; font-weight: bold;\">nano<\/span><\/div>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"codebox_plus_footer\">GeSHi &copy; Codebox Plus Extension<\/div>\n<\/div>\n<p><span style=\"font-size:150%;line-height:116%\">2\u3001\u521b\u5efa\u9a71\u52a8\u52a0\u8f7d\u6587\u4ef6<\/span><\/p>\n<div class=\"codebox_plus_wrap\">\n<div class=\"codebox_plus_header\"><strong>Code: <\/strong><a href=\"#\" onclick=\"codebox_plus_select(this, 1); return false;\">[\u5168\u9009]<\/a>&nbsp;<a href=\"#\" onclick=\"codebox_plus_toggle(this, 1); return false;\">[Expand\/Collapse]<\/a><\/div>\n<div>\n<div style=\"display: inline;\">\n<div class=\"bash\" style=\"font-family:monospace;\">\n<ol>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\"><span style=\"color: #c20cb9; font-weight: bold;\">nano<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>hotplug.d<span style=\"color: #000000; font-weight: bold;\">\/<\/span>usb<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #000000;\">20<\/span>-printer<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"codebox_plus_footer\">GeSHi &copy; Codebox Plus Extension<\/div>\n<\/div>\n<p><span style=\"font-size:150%;line-height:116%\">\u5185\u5bb9\u5982\u4e0b<\/span><\/p>\n<div class=\"codebox_plus_wrap\">\n<div class=\"codebox_plus_header\"><strong>Code: <\/strong><a href=\"#\" onclick=\"codebox_plus_select(this, 1); return false;\">[\u5168\u9009]<\/a>&nbsp;<a href=\"#\" onclick=\"codebox_plus_toggle(this, 1); return false;\">[Expand\/Collapse]<\/a><\/div>\n<div>\n<div style=\"display: inline;\">\n<div class=\"ini\" style=\"font-family:monospace;\">\n<ol>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">#!\/bin\/sh<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\"><span style=\"color: #000099;\">FIRMWARE<\/span><span style=\"color: #000066; font-weight:bold;\">=<\/span><span style=\"color: #933;\">&quot;\/usr\/lib\/sihp1020.dl&quot;<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\"><span style=\"color: #000099;\">DEVICE<\/span><span style=\"color: #000066; font-weight:bold;\">=<\/span><span style=\"color: #660066;\">\/dev\/usb\/lp0<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\"><span style=\"color: #000099;\">LOGFILE<\/span><span style=\"color: #000066; font-weight:bold;\">=<\/span><span style=\"color: #660066;\">\/var\/log\/printer<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">if <span style=\"\">&#91;<\/span> <span style=\"color: #933;\">&quot;$PRODUCT&quot;<\/span> <span style=\"color: #000066; font-weight:bold;\">=<\/span> <span style=\"color: #933;\">&quot;3f0\/2b17\/100&quot;<\/span> -a <span style=\"color: #933;\">&quot;$ACTION&quot;<\/span> <span style=\"color: #000066; font-weight:bold;\">=<\/span> <span style=\"color: #933;\">&quot;add&quot;<\/span> <span style=\"\">&#93;<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">then<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; for i in $<span style=\"\">&#40;<\/span>seq <span style=\"\">30<\/span><span style=\"\">&#41;<\/span><span style=\"color: #666666; font-style: italic;\">; do<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if <span style=\"color: #000066; font-weight:bold;\"><span style=\"\">&#91;<\/span> -c $DEVICE <span style=\"\">&#93;<\/span><\/span><span style=\"color: #666666; font-style: italic;\">; then<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo <span style=\"color: #933;\">&quot;$(date) : Sending firmware to printer.&quot;<\/span> &gt; $LOGFILE<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cat $FIRMWARE &gt; $DEVICE<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo <span style=\"color: #933;\">&quot;$(date) : done.&quot;<\/span> &gt;&gt; $LOGFILE<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sleep <span style=\"\">1<\/span><\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; done<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">fi<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"codebox_plus_footer\">GeSHi &copy; Codebox Plus Extension<\/div>\n<\/div>\n<p><span style=\"font-size:150%;line-height:116%\">3\u3001\u6253\u5370\u670d\u52a1\u5668\u8bbe\u7f6e<\/span><\/p>\n<div class=\"inline-attachment\"><!-- ia0 -->910nd.PNG<!-- ia0 --><\/div>\n<p><span style=\"font-size:150%;line-height:116%\">4\u3001\u9632\u706b\u5899\u8bbe\u7f6e<\/span><\/p>\n<div class=\"codebox_plus_wrap\">\n<div class=\"codebox_plus_header\"><strong>Code: <\/strong><a href=\"#\" onclick=\"codebox_plus_select(this, 1); return false;\">[\u5168\u9009]<\/a>&nbsp;<a href=\"#\" onclick=\"codebox_plus_toggle(this, 1); return false;\">[Expand\/Collapse]<\/a><\/div>\n<div>\n<div style=\"display: inline;\">\n<div class=\"bash\" style=\"font-family:monospace;\">\n<ol>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\"><span style=\"color: #c20cb9; font-weight: bold;\">nano<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>config<span style=\"color: #000000; font-weight: bold;\">\/<\/span>firewall<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"codebox_plus_footer\">GeSHi &copy; Codebox Plus Extension<\/div>\n<\/div>\n<p>\u5728\u6587\u4ef6\u6700\u540e\u6dfb\u52a0<\/p>\n<div class=\"codebox_plus_wrap\">\n<div class=\"codebox_plus_header\"><strong>Code: <\/strong><a href=\"#\" onclick=\"codebox_plus_select(this, 1); return false;\">[\u5168\u9009]<\/a>&nbsp;<a href=\"#\" onclick=\"codebox_plus_toggle(this, 1); return false;\">[Expand\/Collapse]<\/a><\/div>\n<div>\n<div style=\"display: inline;\">\n<div class=\"bash\" style=\"font-family:monospace;\">\n<ol>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">config rule &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; option src lan &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; option proto tcp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; option dest_port <span style=\"color: #000000;\">9100<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/div>\n<\/li>\n<li style=\"margin-left:20px;\">\n<div style=\"border-bottom: dotted 1px #cccccc;\">&nbsp; &nbsp; &nbsp; option target ACCEPT<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"codebox_plus_footer\">GeSHi &copy; Codebox Plus Extension<\/div>\n<\/div>\n<p>\u91cd\u65b0\u542f\u52a8\u8def\u7531\u5668\u3002<br \/>\n<span style=\"font-size:150%;line-height:116%\">5\u3001WINDOWS\u6253\u5370\u9a71\u52a8\u6309\u7f51\u7edc\u6253\u5370\u673a\u5b89\u88c5\uff0c<strong class=\"text-strong\"><span style=\"color:#FF0000\">\u6ce8\uff1a\u4e0d\u8981\u9009\u62e9\u53cc\u5411\u6253\u5370\uff0c\u5426\u5219\u4f1a\u4e0d\u505c\u91cd\u590d\u6253\u5370<\/span><\/strong>\u3002<\/span><\/p>\n<p><small>\u539f\u6587\u4f5c\u8005: BG6RSH | <a href=\"https:\/\/bbs.tansoo.cn\/viewtopic.php?t=48\" target=\"_blank\" rel=\"noopener\">\u67e5\u770b\u539f\u5e16<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u8def\u7531\u5668USB\u6253\u5370\u5171\u4eab\u8bbe\u7f6e https:\/\/openwrt.org\/ru\/do &hellip; <a href=\"https:\/\/www.tansoo.cn\/?p=1459\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-1459","post","type-post","status-publish","format-standard","hentry","category-105"],"_links":{"self":[{"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts\/1459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1459"}],"version-history":[{"count":0,"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts\/1459\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}