openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

publish.sh (1052B)


      1 #!/bin/bash
      2 #
      3 # en:
      4 # Example for publishing a page via batch.
      5 #
      6 # de:
      7 # Beispiel für eine batchgesteuerte Veröffentlichung.
      8 
      9 URL=http://example.com/~user/openrat
     10 COOKIEFILE=tmpcookie.txt
     11 LOGFILE=publish.log
     12 
     13 echo "" > $COOKIEFILE
     14 echo "---" > $LOGFILE
     15 echo "Do Login..."
     16 
     17 wget --save-cookies $COOKIEFILE \
     18 	--keep-session-cookies \
     19 	-O testlogin.html \
     20 	--post-data='action=index&subaction=login&dbid=pgsql&login_name=publisher&login_password=xxxxxxxx' \
     21 	-a $LOGFILE \
     22 	$URL/do.php
     23 
     24 echo "Cookie:"
     25 cat $COOKIEFILE
     26 
     27 echo "Selecting project..."
     28 wget --load-cookies $COOKIEFILE \
     29 	-O testproject.html \
     30 	-a $LOGFILE \
     31 	--post-data='action=index&subaction=project&id=2' \
     32 	$URL/do.php
     33 
     34 echo "Do publish page now... please wait"
     35 wget --load-cookies $COOKIEFILE \
     36 	-O testpagepubnow.html \
     37 	-a $LOGFILE \
     38 	--post-data='action=page&subaction=pubnow&id=6' \
     39 	$URL/do.php
     40 
     41 echo "Logout..."
     42 wget --load-cookies $COOKIEFILE \
     43 	-O testlogout.html \
     44 	-a $LOGFILE \
     45 	--post-data='action=index&subaction=logout' \
     46 	$URL/do.php
     47 
     48 echo "finished"
     49 rm $COOKIEFILE
     50 
     51 exit