Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #---------- config start----------
- username="username"
- password="password"
- server="newsserver"
- temppath="path of temp dir used to post material es: /media/dati/"
- newsgroup="newsgroup, es: alt.binaries.multimedia.divx.italian"
- poster="poster name, es: poster"
- email="email address, es: poster@gmail.com"
- #---------- config end----------
- error="false"
- filename="$(basename $1)"
- subject="${filename%.*}"
- function checkLastCommand {
- if [ "$1" != "0" ]; then
- error="true"
- fi
- }
- #rar split of file
- rar a "$temppath$filename" -v40m -m0 $1
- #checkresult
- checkLastCommand "$?"
- #create par
- if [ "$error" != "true" ]; then
- par2create -r10 -n7 "$temppath$filename" "$temppath"*.rar*
- fi
- #checkresult
- checkLastCommand "$?"
- #post
- if [ "$error" != "true" ]; then
- newspost -i "$server" -u "$username" -p "$password" -f "$email" -n "$newsgroup" -y -s "$subject" "$temppath"*
- fi
- #checkresult
- checkLastCommand "$?"
- #delete tmpfile
- if [ "$error" != "true" ]; then
- rm "$temppath"*
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement