Friday 22 February 2013

WGET on CheckPoint

Just a quick post here since I've been asked about the best way of transfering the scripts I host on github to a FW. The answer of course is wget :)

It's not in the default $PATH of SPLAT/GAIA, however on every version I've looked CP has hidden it somewhere on the device.

For example:
[Expert@R75-B]# wget
-bash: wget: command not found
[Expert@R75-B]# find / -name wget
/var/tmp/CD1/linux/MiniWrapperForMajor/linux/Actions/wget
/sysimg/CPwrapper/linux/MiniWrapperForMajor/linux/Actions/wget

If you want to pull one of my scripts down directly (and assuming you've got a name server in /etc/resolv.conf...), just use the binary in one of the results from find like so:

Tada:
[Expert@R75-B]# /sysimg/CPwrapper/linux/MiniWrapperForMajor/linux/Actions/wget https://raw.github.com/craigdods/scripts/master/interface_rebuild_splat.sh
--10:14:27--  https://raw.github.com/craigdods/scripts/master/interface_rebuild_splat.sh
           => `interface_rebuild_splat.sh.1'
Resolving raw.github.com... done.
Connecting to raw.github.com[199.27.72.133]:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 748 [text/plain]

100%[=================================================================================================================================================================================================>] 748          730.47K/s    ETA 00:00

10:14:27 (730.47 KB/s) - `interface_rebuild_splat.sh.1' saved [748/748]



3 comments:

  1. For R76 there is no wget ... find / -name wget has no result.

    ReplyDelete
  2. When done you also have to change the permissions on the file so you can run it, "chmod 777 top_talkers.sh"

    ALso, using the IP in wget doesnt work as github won't allow it, so you have to put in a dns server via sysconfig (like 4.2.2.2)

    ReplyDelete
  3. You are correct - the same can be said for any script.

    Also, you don't need to 777 an executable, all you have to do is +x it
    ie: chmod +x top_talkers.sh

    As for wget missing in R76, apparently it will be coming back shortly :)

    ReplyDelete