#!/bin/sh # vytvoril iko ( iko@kamarad.cz ) # # 1 parameter: jpg subor, ktory sa ma poslat # # postup: # 1. prihlasit sa do happy foto ( adresa http://digi.happyfoto.sk ) # 2. do premennej ID skopirovat z prihlasenej URL aktualne ID ID="491C23A80000A7BB57739A191F3E97A72EAB387F71530B05" ########################################################################### ########################################################################### n=`basename "$1"` cat >/tmp/upload_file_http <>/tmp/upload_file_http cat >>/tmp/upload_file_http </tmp/upload_file_http_ <>/tmp/upload_file_http_ && mv /tmp/upload_file_http_ /tmp/upload_file_http x=`cat /tmp/upload_file_http | wc -c` cat /tmp/upload_file_http | pv -s $x | nc digi-sk.happy-foto.com 80 >/tmp/upload_file_res if [ "`cat /tmp/upload_file_res | grep 'HTTP/1.1 200 OK'`" ]; then rm -f /tmp/upload_file_http /tmp/upload_file_res echo "OK" exit 0 else rm -f /tmp/upload_file_http /tmp/upload_file_res echo "ERROR" exit 1 fi