<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Curl command for script]]></title><description><![CDATA[<p dir="auto">Hey people,</p>
<p dir="auto">I am trying to create a script to turn on/off my wan interface at certain times</p>
<p dir="auto">I have the url's:</p>
<pre><code>
http://192.168.1.254/status_interfaces.php?action=Connect&amp;if=wan
http://192.168.1.254/status_interfaces.php?action=Disconnect&amp;if=wan

</code></pre>
<p dir="auto">however my curl skills are non existent :(  but I need to provide my admin username &amp; password &amp; i have no clue how to do this.</p>
<p dir="auto">What I am attempting to do here is to:<br />
turn on my 3g after 23:00<br />
check a work server for a change<br />
if change present then rsync<br />
if no change present disconnect from work<br />
disconnect 3g</p>
<p dir="auto">I have to do this after 23:00 because at that time I know no one will be working &amp; potentially this can be a large download upto 1 Gb &amp; I do not wish to do this prior to 2300 as this will affect my daytime (yes I have 2 allowance's daytime: 0500-2300 &amp; night time: 2300-0500) 3g bandwidth allowance which is used by my family also leaving the dongle connected is not an option as everyone leaves their pc's turned on &amp; possibly webpages, IM clients, skype etc all running too, so if I leave it connected bandwidth is consumed for no reason which is not good for 3G!!!.</p>
<p dir="auto">Thanks in advance for any advice :)</p>
]]></description><link>https://forum.netgate.com/topic/54430/curl-command-for-script</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 03:29:03 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/54430.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 21 Mar 2013 15:09:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Curl command for script on Fri, 26 Apr 2013 05:50:42 GMT]]></title><description><![CDATA[<p dir="auto">Here are the commands in curl (wish I found that wiki link a while back I had to work these out):</p>
<p dir="auto">login (replace the url username &amp; password:</p>
<p dir="auto">curl -k -L -b cookies.txt -c cookies.txt –verbose -d "usernamefld=yourusernamehere&amp;passwordfld=yourpasswordherer&amp;login=Login" "https://192.168.1.1/index.php"</p>
<p dir="auto">To do a post:</p>
<p dir="auto">curl -k -L -b cookies.txt -c cookies.txt --verbose -d "action=Disconnect&amp;if=wan" "https://192.168.1.1/status_interfaces.php"</p>
<p dir="auto">NOTE: A lot of the pfsense pages use csrf. It this case you have to get the value from the page you are posting from and post that with the command. Luckily for you the status_interfaces page does not use them :)</p>
]]></description><link>https://forum.netgate.com/post/392206</link><guid isPermaLink="true">https://forum.netgate.com/post/392206</guid><dc:creator><![CDATA[charlie0440]]></dc:creator><pubDate>Fri, 26 Apr 2013 05:50:42 GMT</pubDate></item><item><title><![CDATA[Reply to Curl command for script on Mon, 15 Apr 2013 13:01:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jimp">@<bdi>jimp</bdi></a>:</p>
<blockquote>
<p dir="auto">You'll need to "login" first and save cookies, as is done on the backup page:</p>
<p dir="auto">http://doc.pfsense.org/index.php/Remote_Config_Backup</p>
</blockquote>
<p dir="auto">Thanks for the response. Yea kinda gathered I would need to login in some way but from previous experience using wget in scripts can cause problems hence why I mentioned CURL.</p>
]]></description><link>https://forum.netgate.com/post/389813</link><guid isPermaLink="true">https://forum.netgate.com/post/389813</guid><dc:creator><![CDATA[t0m5k1]]></dc:creator><pubDate>Mon, 15 Apr 2013 13:01:45 GMT</pubDate></item><item><title><![CDATA[Reply to Curl command for script on Wed, 27 Mar 2013 19:16:19 GMT]]></title><description><![CDATA[<p dir="auto">You'll need to "login" first and save cookies, as is done on the backup page:</p>
<p dir="auto">http://doc.pfsense.org/index.php/Remote_Config_Backup</p>
]]></description><link>https://forum.netgate.com/post/386863</link><guid isPermaLink="true">https://forum.netgate.com/post/386863</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Wed, 27 Mar 2013 19:16:19 GMT</pubDate></item></channel></rss>