Advertisement
ujiajah1

squid ip fire dari group ip fire created om cespun

Feb 19th, 2016
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 15.44 KB | None | 0 0
  1. #!/bin/sh
  2. # Begin $rc_base/init.d/squid
  3. . /etc/sysconfig/rc
  4. . $rc_functions
  5. chown -R squid:squid /var/log/squid
  6. chown -R squid:squid /var/log/squidGuard
  7. transparent() {
  8. DEVICE=$1
  9. eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
  10. eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
  11. # If the proxy port is not set we set the default to 800.
  12. if [ -z "${TRANSPARENT_PORT}" ]; then
  13. TRANSPARENT_PORT=800
  14. fi
  15. LOCALIP=`cat /var/ipfire/red/local-ipaddress | tr -d \n`
  16. if [ -z $LOCALIP ]; then
  17. boot_mesg "Couldn't read local-ipaddress" ${FAILURE}
  18. exit 1
  19. fi
  20. COUNT=1
  21. FILE=/var/ipfire/vpn/config
  22. while read LINE; do
  23. let COUNT=$COUNT+1
  24. CONN_TYPE=`echo "$LINE" | awk -F, '{ print $5 }'`
  25. if [ "$CONN_TYPE" != "net" ]; then
  26. continue
  27. fi
  28. iptables -t nat -A SQUID -i $1 -p tcp -d `echo "$LINE" | awk -F, '{ print $13 }'` --dport 80 -j RETURN
  29. done < $FILE
  30. if [ "$RED_TYPE" == "STATIC" ]; then
  31. iptables -t nat -A SQUID -i $1 -p tcp -d $RED_NETADDRESS/$RED_NETMASK --dport 80 -j RETURN
  32. fi
  33. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 80 -j RETURN
  34. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 443 -j RETURN
  35. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 5050 -j RETURN
  36. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 8080 -j RETURN
  37. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 88 -j RETURN
  38. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 182 -j RETURN
  39. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 8777 -j RETURN
  40. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 8081 -j RETURN
  41. iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 1935 -j RETURN
  42. iptables -t nat -A SQUID -i $1 -p tcp --dport 80 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  43. iptables -t nat -A SQUID -i $1 -p tcp --dport 443 -j REDIRECT --to-port 3129
  44. iptables -t nat -A SQUID -i $1 -p tcp --dport 5050 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  45. iptables -t nat -A SQUID -i $1 -p tcp --dport 8080 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  46. iptables -t nat -A SQUID -i $1 -p tcp --dport 88 -j REDIRECT --to-port 3129
  47. iptables -t nat -A SQUID -i $1 -p tcp --dport 182 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  48. iptables -t nat -A SQUID -i $1 -p tcp --dport 8777 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  49. iptables -t nat -A SQUID -i $1 -p tcp --dport 8081 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
  50. iptables -t nat -A SQUID -i $1 -p tcp --dport 1935 -j REDIRECT --to-port 3129
  51. }
  52. case "$1" in
  53. start)
  54. getpids "squid"
  55. if [ -n "${pidlist}" ]; then
  56. echo -e "Squid is already running with Process"\
  57. "ID(s) ${pidlist}.${NORMAL}"
  58. evaluate_retval
  59. exit
  60. fi
  61. eval $(/usr/local/bin/readhash /var/ipfire/proxy/advanced/settings)
  62. eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
  63. if [ -e /var/ipfire/proxy/enable -o -e /var/ipfire/proxy/enable_blue ]; then
  64. # Add Address to errorpage stylesheet
  65. sed "s|XXXhostXXX|$GREEN_ADDRESS|g" /var/ipfire/proxy/errorpage-$ERR_DESIGN.css > \
  66. /etc/squid/errorpage.css
  67. boot_mesg "Creating Squid swap directories..."
  68. /usr/sbin/squid -z >/dev/null 2>&1
  69. evaluate_retval
  70. # Make sure, that the process above has finished.
  71. counter=5
  72. while [ ${counter} -gt 0 ]; do
  73. if pidofproc -s /usr/sbin/squid; then
  74. sleep 1
  75. else
  76. break
  77. fi
  78. done
  79. boot_mesg "Starting Squid Proxy Server..."
  80. loadproc /usr/sbin/squid
  81. fi
  82. #‎if‬ [ -e /var/ipfire/proxy/transparent ]; then
  83. # transparent $GREEN_DEV
  84. #‎fi‬
  85. #if [ -e /var/ipfire/proxy/transparent_blue ]; then
  86. # transparent $BLUE_DEV
  87. #fi
  88. if [ -e /var/ipfire/proxy/transparent ]; then
  89. transparent $GREEN_DEV
  90. elif [ -e /var/ipfire/proxy/transparent_blue ]; then
  91. transparent $BLUE_DEV
  92. else
  93. modprobe xt_TPROXY
  94. modprobe xt_socket
  95. #modprobe nf_tproxy_core
  96. modprobe xt_mark
  97. modprobe nf_nat
  98. modprobe nf_conntrack_ipv4
  99. modprobe nf_conntrack
  100. modprobe nf_defrag_ipv4
  101. modprobe ipt_REDIRECT
  102. iptables -t mangle -F
  103. iptables -t nat -F
  104. iptables -t mangle -N DIVERT
  105. iptables -t mangle -A DIVERT -j MARK --set-mark 1
  106. iptables -t mangle -A DIVERT -j ACCEPT
  107. iptables -t mangle -A INPUT -j ACCEPT
  108. iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
  109. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  110. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 5050 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  111. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 8080 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  112. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 88 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  113. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 182 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  114. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 8777 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  115. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 8081 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  116. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 1935 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  117. iptables -t mangle -A PREROUTING ! -d 192.168.21.212/32 -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  118. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 80 -j ACCEPT
  119. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 5050 -j ACCEPT
  120. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 8080 -j ACCEPT
  121. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 88 -j ACCEPT
  122. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 182 -j ACCEPT
  123. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 8777 -j ACCEPT
  124. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 8081 -j ACCEPT
  125. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 1935 -j ACCEPT
  126. iptables -t mangle -A PREROUTING -d 192.168.21.212/32 -p tcp --dport 443 -j ACCEPT
  127. ip rule add fwmark 1 lookup 100
  128. ip route add local 0.0.0.0/0 dev lo table 100
  129. sysctl net.ipv4.ip_nonlocal_bind=1
  130. sysctl net.ipv4.ip_forward=1
  131. fi
  132. ;;
  133. stop)
  134. iptables -t nat -F SQUID
  135. if [ -e /var/run/squid.pid ]; then
  136. boot_mesg "Stopping Squid Proxy Server..."
  137. squid -k shutdown >/dev/null 2>&1
  138. evaluate_retval
  139. # Stop squidGuard, updxlrator, squidclamav
  140. # and redirect_wrappers.
  141. killproc /usr/bin/squidGuard >/dev/null &
  142. killproc /usr/sbin/updxlrator >/dev/null &
  143. killproc /usr/bin/squidclamav >/dev/null &
  144. killproc /usr/sbin/redirect_wrapper >/dev/null &
  145. # Wait until all redirectors have been stopped.
  146. wait
  147. # If squid is still running, wait up to 30 seconds
  148. # before we go on to kill it.
  149. counter=30
  150. while [ ${counter} -gt 0 ]; do
  151. statusproc /usr/sbin/squid >/dev/null && break;
  152. sleep 1
  153. counter=$(( ${counter} - 1))
  154. done
  155. # Kill squid service, if still running.
  156. killproc /usr/sbin/squid >/dev/null
  157. # Trash remain pid file from squid.
  158. rm -rf /var/run/squid.pid
  159. fi
  160. ;;
  161. restart)
  162. $0 stop
  163. sleep 5
  164. $0 start
  165. ;;
  166. reconfigure)
  167. /usr/sbin/squid -k reconfigure
  168. ;;
  169. status)
  170. statusproc /usr/sbin/squid
  171. statusproc /usr/lib/squid/unlinkd
  172. ;;
  173. flush)
  174. $0 stop
  175. echo > /var/log/cache/swap.state
  176. chown squid.squid /var/log/cache/swap.state
  177. sleep 1
  178. $0 start
  179. ;;
  180. setperms)
  181. chown -R nobody.squid /var/updatecache/
  182. ;;
  183. *)
  184. echo "Usage: $0 {start|stop|restart|status|flush}"
  185. exit 1
  186. ;;
  187. esac
  188. # End $rc_base/init.d/squid
  189. ==== /etc/init.d/squid , end before baris ini ====
  190. ==== /etc/squid/squid.conf.pre.local , start after baris ini ====
  191. http_port 192.168.21.212:3128 tproxy
  192. https_port 192.168.21.212:3129 tproxy ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/certs/squid.pem key=/etc/squid/certs/squid.key cipher=ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:AES128-SHA:RC4-SHA:HIGH:!aNULL:!MD5:!ADH
  193. #‎https_port‬ 192.168.21.212:3129 tproxy ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/certs/squid.pem key=/etc/squid/certs/squid.key options=NO_SSLv2,SINGLE_DH_USE cipher=HIGH
  194. refresh_all_ims on
  195. reload_into_ims on
  196. maximum_object_size_in_memory 0 KB
  197. strip_query_terms off
  198. cache_swap_high 98
  199. cache_swap_low 95
  200. qos_flows local-hit=0x30
  201. qos_flows sibling-hit=0x30
  202. qos_flows parent-hit=0x30
  203. dns_nameservers 208.67.222.222 208.67.220.220
  204. ### semua acl
  205. acl youtube url_regex -i (youtube|googlevideo|videoplayback)
  206. acl ytvideo url_regex -i ^http.*videoplayback.*mime\=video.*
  207. #‎force‬ itag to itag=134 for mp4 or force itag to itag=243 for webm
  208. acl ytitag url_regex -i ^http.*videoplayback.*itag\=(160|133|135|136|137|138|264|266|298|299|167|168|169|170|218|219|242|244|245|246|247|248|271|272|278|302|303|308|313|315).*
  209. acl httptomiss http_status 302
  210. acl mimetext rep_mime_type -i mime-type ^text/html
  211. acl mimetext rep_mime_type -i mime-type ^text/plain
  212. acl patchpartial url_regex -i ^http.*(garena|gemscool|netmarble|valve|dota|winnerinter|lytogame|megaxus).*(patch|Patch).*
  213. acl tostoreid url_regex -i ^https?\:\/\/.*youtube.*api.*stats.*ads.*
  214. acl tostoreid url_regex -i ^https?\:\/\/.*youtube.*(ptracking|set_awesome).*
  215. acl tostoreid url_regex -i ^https?\:\/\/.*youtube.*(stream_204|watchtime|qoe|atr).*
  216. acl tostoreid url_regex -i ^https?\:\/\/.*youtube.*player_204.*
  217. acl tostoreid url_regex -i ^https?\:\/\/.*(youtube|googlevideo).*videoplayback.*
  218. acl tostoreid url_regex -i ^https?\:\/\/.*utm.gif.*
  219. acl tostoreid url_regex -i ^https?\:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*
  220. acl tostoreid url_regex -i ^https?\:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*\/.*)\?.*
  221. acl tostoreid url_regex -i ^https?\:\/\/.*datafilehost.*\/get\.php.*file\=(.*)
  222. acl tostoreid url_regex -i ^https?\:\/\/.*(speedtest|espeed).*\/(.*\.(jpg|txt|png|bmp)).*
  223. acl tostoreid url_regex -i ^https?\:\/\/.*\.filehippo\.com\/.*\/(.*\/.*)
  224. acl tostoreid url_regex -i ^https?\:\/\/.*\.4shared\.com\/.*\/(.*\/.*)\/dlink.*preview.mp3
  225. acl tostoreid url_regex -i ^https?\:\/\/.*\.4shared\.com\/download\/(.*\/.*)\?tsid.*
  226. acl tostoreid url_regex -i ^https?\:\/\/.*steampowered.*\/(client|depot)\/(.*)\?.*
  227. acl tostoreid url_regex -i ^https?\:\/\/.*steampowered.*\/(client|depot)\/(.*)
  228. acl tostoreid url_regex -i ^https?:\/\/www\.savefile\.co\:182\/.*\/(.*\.(mp4|flv|3gp)).*
  229. acl tostoreid url_regex -i ^https?\:\/\/.*(fbcdn\.net|akamaihd\.net)\/(hprofile|hphoto|hvideo).*\/([a-z]\d+x\d+\/.*\.(jpg|jpeg|bmp|png|gif|ico)|.*\.(mp4|mp3|flv|3gp|mkv))\?.*
  230. acl step1 at_step SslBump1
  231. acl step2 at_step SslBump2
  232. acl step3 at_step SslBump3
  233. acl getmethod method GET
  234. http_access deny ytvideo ytitag
  235. quick_abort_min 0 KB
  236. quick_abort_max 0 KB
  237. quick_abort_pct 98
  238. range_offset_limit none patchpartial
  239. range_offset_limit 128 KB !patchpartial
  240. reply_header_access Alternate-Protocol deny youtube
  241. cache deny localhost
  242. ssl_bump splice localhost
  243. ssl_bump peek step1 all
  244. ssl_bump stare step2 all
  245. ssl_bump splice step3 all
  246. sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/ipfire/ssl_db -M 4MB
  247. sslcrtd_children 2000 startup=1 idle=1
  248. sslproxy_capath /etc/ssl/certs
  249. sslproxy_cert_error allow all
  250. sslproxy_flags DONT_VERIFY_PEER
  251. always_direct allow all
  252. ssl_unclean_shutdown on
  253. store_id_program /etc/squid/storeid.pl
  254. store_id_children 2000 startup=1 idle=1
  255. store_id_access deny !getmethod
  256. store_id_access allow tostoreid
  257. store_id_access deny all
  258. store_miss deny youtube httptomiss
  259. send_hit deny youtube httptomiss
  260. store_miss deny youtube mimetext
  261. send_hit deny youtube mimetext
  262. refresh_pattern . 0 95% 432000 override-expire override-lastmod ignore-no-cache ignore-no-store ignore-private ignore-auth ignore-must-revalidate
  263. max_stale 1 seconds
  264. ==== /etc/squid/squid.conf.pre.local , end before baris ini ====
  265. ==== /etc/squid/storeid.pl , start after baris ini ====
  266. #!/usr/bin/perl
  267. $|=1;
  268. while (<>) {
  269. @X = split;
  270. if ($X[0] =~ m/^https?\:\/\/.*/) {
  271. $x = $X[0];
  272. $_ = $X[0];
  273. $u = $X[0];
  274. } else {
  275. $x = $X[1];
  276. $_ = $X[1];
  277. $u = $X[1];
  278. }
  279. #‎ads‬ youtube
  280. if ($x=~ m/^https?\:\/\/.*youtube.*api.*stats.*ads.*/){
  281. @content_v = m/[&?]content_v\=([^\&\s]*)/;
  282. @cpn = m/[%&?\/](cpn[%&=\/][^\&\s\/]*)/;
  283. unless (-e "/tmp/@cpn"){
  284. open FILE, ">/tmp/@cpn";
  285. print FILE "id=@content_v";
  286. close FILE;
  287. }
  288. $out="ERR";
  289. #‎tracking‬ youtube
  290. } elsif ($x=~ m/^https?\:\/\/.*youtube.*(ptracking|set_awesome).*/){
  291. @video_id = m/[&?]video_id\=([^\&\s]*)/;
  292. @cpn = m/[%&?\/](cpn[%&=\/][^\&\s\/]*)/;
  293. unless (-e "/tmp/@cpn"){
  294. open FILE, ">/tmp/@cpn";
  295. print FILE "id=@video_id";
  296. close FILE;
  297. }
  298. $out="ERR";
  299.  
  300. #‎stream_204‬ youtube
  301. } elsif ($x=~ m/^https?\:\/\/.*youtube.*(stream_204|watchtime|qoe|atr).*/){
  302. @docid = m/[&?]docid\=([^\&\s]*)/;
  303. @cpn = m/[%&?\/](cpn[%&=\/][^\&\s\/]*)/;
  304. unless (-e "/tmp/@cpn"){
  305. open FILE, ">/tmp/@cpn";
  306. print FILE "id=@docid";
  307. close FILE;
  308. }
  309. $out="ERR";
  310. #‎player_204‬ youtube
  311. } elsif ($x=~ m/^https?\:\/\/.*youtube.*player_204.*/){
  312. @v = m/[&?]v\=([^\&\s]*)/;
  313. @cpn = m/[%&?\/](cpn[%&=\/][^\&\s\/]*)/;
  314. unless (-e "/tmp/@cpn"){
  315. open FILE, ">/tmp/@cpn";
  316. print FILE "id=@v";
  317. close FILE;
  318. }
  319. $out="ERR";
  320. #‎youtube‬
  321. } elsif ($x=~ m/^https?\:\/\/.*(youtube|googlevideo).*videoplayback.*/){
  322. @cpn = m/[%&?\/](cpn[%&=\/][^\&\s\/]*)/;
  323. @id = m/[%&?\/](id[%&=\/][^\&\s\/]*)/;
  324. @itag = m/[%&?\/](itag[%&=\/][^\&\s\/]*)/;
  325. @range = m/[%&?\/](range[%&=\/][^\&\s\/]*)/;
  326. @slices = m/[%&?\/](slices[%&=\/][^\&\s\/]*)/;
  327. @mime = m/[%&?\/](mime[%&=\/][^\&\s\/]*)/;
  328. if (defined(@cpn[0])){
  329. if (-e "/tmp/@cpn"){
  330. open FILE, "/tmp/@cpn";
  331. @id = <FILE>;
  332. close FILE;}
  333. }
  334. $out="OK store-id=storeid://pc-mikrotik/youtube/@id@itag@mime@range@slices";
  335. #‎utmgif‬
  336. } elsif ($x=~ m/^https?\:\/\/.*utm.gif.*/) {
  337. $out="OK store-id=storeid://pc-mikrotik/__utm.gif";
  338. #‎reverbnation‬
  339. } elsif ($x=~ m/^https?\:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*/) {
  340. $out="OK store-id=http://pc-mikrotik/reverbnation/" . $1;
  341. #‎playstore‬
  342. } elsif ($x=~ m/^https?\:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*\/.*)\?.*/) {
  343. $out="OK store-id=http://pc-mikrotik/android/market/" . $1;
  344. #‎filehost‬
  345. } elsif ($x=~ m/^https?\:\/\/.*datafilehost.*\/get\.php.*file\=(.*)/) {
  346. $out="OK store-id=http://pc-mikrotik/datafilehost/" . $1;
  347. #‎speedtest‬
  348. } elsif ($x=~ m/^https?\:\/\/.*(speedtest|espeed).*\/(.*\.(jpg|txt|png|bmp)).*/) {
  349. $out="OK store-id=http://pc-mikrotik/speedtest/" . $2;
  350. #‎filehippo‬
  351. } elsif ($x=~ m/^https?\:\/\/.*\.filehippo\.com\/.*\/(.*\/.*)/) {
  352. $out="OK store-id=http://pc-mikrotik/filehippo/" . $1;
  353. #‎4shared‬ preview.mp3
  354. } elsif ($x=~ m/^https?\:\/\/.*\.4shared\.com\/.*\/(.*\/.*)\/dlink.*preview.mp3/) {
  355. $out="OK store-id=http://pc-mikrotik/4shared/preview/" . $1;
  356. #4shared
  357. } elsif ($x=~ m/^https?\:\/\/.*\.4shared\.com\/download\/(.*\/.*)\?tsid.*/) {
  358. $out="OK store-id=http://pc-mikrotik/4shared/download/" . $1;
  359. #savefile-animeindo.tv
  360. } elsif ($x=~ m/^https?:\/\/www\.savefile\.co\:182\/.*\/(.*\.(mp4|flv|3gp)).*/) {
  361. $out="OK store-id=http://pc-mikrotik/savefile:182/" . $1;
  362. #‎steampowered‬ dota 2
  363. } elsif ($x=~ m/^https?\:\/\/.*steampowered.*\/(client|depot)\/(.*)\?.*/) {
  364. $out="OK store-id=http://steampowered/" . $1 . "/" . $2;
  365. #steampowered dota 2
  366. } elsif ($x=~ m/^https?\:\/\/.*steampowered.*\/(client|depot)\/(.*)/) {
  367. $out="OK store-id=http://steampowered/" . $1 . "/" . $2;
  368. #‎all‬ url
  369. } elsif ($x=~ m/^https?\:\/\/(.*)/) {
  370. $out="OK store-id=http://" . $1;
  371. #all url
  372. } elsif ($x=~ m/^ftp\:\/\/(.*)/) {
  373. $out="OK store-id=ftp://" . $1;
  374. } else {
  375. $out="ERR";
  376. }
  377. if ($X[0] =~ m/^https?\:\/\/.*/) {
  378. print "$out\n";
  379. } else {
  380. print $X[0] . " " . "$out\n";
  381. }
  382. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement