Subversion Repositories programming

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
89 irasnyd 1
#!/bin/bash
2
 
3
### check both args, print help ###
4
if [ -z "$1" ] && [ -z "$2" ];
5
then echo "You need help...";
6
     echo
7
     echo "Usage: postcreate <FILE_TO_POST> <POST_TITLE>"
8
     exit
9
fi
10
 
11
### check each arg ###
12
if [ -z "$1" ]; then echo "Enter a filename..."; exit; fi;
13
if [ -z "$2" ]; then echo "Enter the post title..."; exit; fi;
14
 
15
MY_NOEXT_NAME="$(echo "$1" | sed 's/\.avi//' | sed 's/\.ogm//' | sed 's/\.mkv//' )"
16
 
17
### Split to rars ###
18
rar a -m0 -v15000000b "${MY_NOEXT_NAME}.rar" "$1"
19
 
20
### make par set at 10% ###
21
par2create -s375000 -r10 "${MY_NOEXT_NAME}.par2" "${MY_NOEXT_NAME}.part??.rar"
22
 
23
### set up newspost ###
24
echo "Sleeping 30 seconds... CHECK YOUR POST NOW"
25
sleep 30
26
newspost -s "$2" -e "${MY_NOEXT_NAME}.nfo" "${MY_NOEXT_NAME}.part??.rar"
27
 
28
### finish up ###
29
echo "Done posting $1"
30