summarylogtreecommitdiffstats
path: root/login.sh
diff options
context:
space:
mode:
authorSigmund2015-07-09 00:03:48 +0100
committerSigmund2015-07-09 00:03:48 +0100
commit164838ce40afff64d97a845465077a239ebe49a7 (patch)
treec9bfe37585eb9cf36480e11ffb4d82ff10a6a391 /login.sh
downloadaur-cula.tar.gz
First commit
Diffstat (limited to 'login.sh')
-rwxr-xr-xlogin.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/login.sh b/login.sh
new file mode 100755
index 000000000000..59769e0d4166
--- /dev/null
+++ b/login.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+relpath=$1
+thefile=$2
+site="http://www.culatools.com/user/plugins/protect/new_rewrite/login.php?v=-any&url=/$relpath/$thefile"
+
+name=cornholio
+pass=password
+
+# get the initial session cookie
+cookies=/tmp/cron-cookies.txt
+wget -O /tmp/login.txt --save-cookies $cookies --keep-session-cookies $site
+str=`grep login_attempt_id /tmp/login.txt`
+idvalue=`echo $str | awk 'login_attempt_id" value="{print $4}' FS='[ ;]' | replace value\= '' | replace '"' ''`
+
+# do the login
+wget -O `pwd`/$thefile --keep-session-cookies --save-cookies $cookies --load-cookies $cookies --post-data="amember_login=$name&amember_pass=$pass&login_attempt_id=$idvalue" $site
+
+rm /tmp/cron-cookies.txt
+rm /tmp/login.txt