EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
rep0 - Cydia Repo Management for iPhoneBy: c0re - Date Submitted: 2009-12-24 15:56:18 #!/bin/bash #=======================================================# # # rep0 # v8.0b # # created by c0re # licensed under CC (CreativeCommons) # http://creativecommons.org/licenses/by-nc-sa/3.0/ # #=======================================================# if [ $(id -u) -ne 0 ]; then #check4root echo -e "\n\a[FATAL ERROR!] you MUST run me as root!" read -sp "..sorry.." echo -e "\n" exit 1 fi echo -e "--created by c0re ($(echo 'c0re@psypanda.org' | tr q m))--" #set them as variables DIR1=/home/c0re/cydia/apps ; export DIR1 DIR2=/home/c0re/cydia/upload ; export DIR2 DIR3=/home/c0re/cydia/upload/debs ; export DIR3 DIR6=main/binary-iphoneos-arm #check for needed dirs if [ ! -d ~/cydia ]; then mkdir -p $DIR1 $DIR3 echo "ALL FOLDERS NOT EXITSTED >> created" >> $HOME/rep0.log else if [ ! -d $DIR1 ]; then mkdir $DIR1 echo "no $DIR1 folder existed >> created" >> $HOME/rep0.log; fi if [ ! -d $DIR2 ]; then mkdir -p $DIR2 echo "no $DIR2 folder existed >> created" >> $HOME/rep0.log; fi if [ ! -d $DIR3 ]; then mkdir $DIR3 echo "no $DIR3 folder existed >> created" >> $HOME/rep0.log; fi fi while [ answer != "e" ]; do #menu clear echo -e "[Hello $USER] what can I do for you?\n" echo " 1 clear all old .deb's 2 build all .debs in one klick 3 build the Package-List 4 sign the Release file with GPGkey 5 upload everything to an FTP Server" echo -e "\n[OTHER OPTIONS]\n" echo " gpg create a gpg key e exit" echo -e "\n--------------------------------------------------------------\n" read -p " Sir ? " answer case "$answer" in 1|rem|rm|RM|REM) echo -e "\n..removing all old files now!\n" find $DIR2 \( -name "*.bz2" -o -name "Packages" \) -print0 | xargs -0 rm -Rf find $DIR2 -name "Release.gpg" -print0 | xargs -0 rm -Rf for file in $DIR3/*.deb; do if [ ! "$file" = "$DIR3/*.deb" ]; then rm -Rf $file #remove old .debs else echo -e "\n\a[WARNING!] no .deb's in $DIR3" echo -e "..so nothing removed!\n" fi done read -sp "[DONE!] ..deleted all old files I could find!" ;; 2|deb|DEB) find $DIR1 \( -name "postinst" -o -name "postrm" \) -exec chmod 0755 {} + find $DIR1 \( -name "preinst" -o -name "prerm" \) -exec chmod 0755 {} + find $DIR1 \( -name "extrainst_" -o -name "control" \) -exec chmod 0755 {} + find $DIR1 -type d -name "DEBIAN" -exec chmod 0755 {} + find $DIR1 -type f -name "*~" -print0 | xargs -0 rm -Rf #dont pack 'files~' echo -e "\n..building all packages now!\n" for file in $DIR1/*; do if [ ! "$file" = "$DIR1/*" ]; then dpkg-deb -b $file #pack 'em else echo -e "\n\a[ERROR!] no folders in $DIR1" read -sp "so nothing moved!" fi done sleep 1 echo -e "\n..moving them to upload folder\n" for filez in $DIR1/*.deb; do if [ ! "$filez" = "$DIR1/*.deb" ]; then echo "moving $filez to $DIR3" mv $filez $DIR3 #move 'em else echo -e "\n\a[ERROR!] no .deb's in $DIR1" read -sp "..so nothing moved" fi done read -sp "[DONE!] ..packed' and moved all files I could find!" ;; 3|list|LIST) createdpkg() { echo -e "..building the Packagelist\n" cd $DIR2 dpkg-scanpackages -m . /dev/null >Packages #create Packagelist sleep 1 if [ -f $DIR2/Packages ]; then echo -e "\n...compressing it...\n" bzip2 -k -f $DIR2/Packages #compress&move read -sp "[DONE!] ..Packagelist created & compressed!" else echo -e "\n\a[ERROR!] Packageliste was NOT created!" read -sp "..so nothing compressed!" sleep 1 fi } echo if [ -f /usr/bin/dpkg-scanpackages ] && [ -f /etc/perl/dpkg-gettext.pl ]; then createdpkg #all good else if [ ! -f /usr/bin/dpkg-scanpackages ]; then echo -e "\n\a[ERROR!] essential file 'dpkg-scanpackages' not found!" read -p " ..try to download it?.. [Y/N] " choice_1 case "$choice_1" in yes|YES|y|Y) aptitude -y install dpkg-dev echo -e "\n..retrying now...\n" sleep 1 createdpkg #retry now.. ;; no|NO|n|N) echo -e "\n ..please download dpkg-scanpackages manually and place it in /usr/bin/" echo "..exiting now!" sleep 2 exit 1 ;; *) echo -e "\nsorry, but "$choice_1" is not a valid answer to my question!" read -sp "..please try again!" ;; esac else if [ ! -f /etc/perl/dpkg-gettext.pl ]; then echo -e "\n\a[ERROR!] essential file 'dpkg-gettext.pl' not found!" read -p " ..try to download it?.. [Y/N] " choice_2 case "$choice_2" in yes|YES|y|Y) download=http://downloads.psypanda.org/dpkg-gettext.gz secTEMP=$(mktemp -d) #open secTEMP wget $download -o $secTEMP gunzip $secTEMP/dpkg-gettext.gz if [ -f $secTEMP/dpkg-gettext.pl ]; then cp $secTEMP/dpkg-gettext.pl /etc/perl chmod 0777 /etc/perl/dpkg-gettext.pl else echo -e "\n\a[ERROR!] dpkg-gettext.pl doesn't exist in $secTEMP" echo "..you need to download dpkg-gettext.pl manually & run me again!" exit 1 fi echo -e "\n..retrying now...\n" sleep 1 rm -Rf $secTEMP createdpkg #retry now.. ;; no|NO|n|N) echo -e "\n\a ..please download dpkg-gettext.pl manually and place it in /etc/perl/" echo "..exiting now!" sleep 2 exit 1 ;; *) echo -e "\nsorry, but "$choice_2" is not a valid answer to my question!" read -sp "..please try again!" ;; esac fi fi fi ;; 4|sign|SIGN) echo -e "\n======================================================= \a [WARNING!] MAKE SURE YOU KNOW WHAT YOUR DOING! =======================================================" read -sp "..otherwise please press CTRL+C to cancel now!!" echo -e "\nwriting MD5Sums to Release file.." if [ ! -f $DIR2/Packages ] || [ ! -f $DIR2/Packages.bz2 ]; then echo -e "\a[ERROR!] you havent created a Package file!" read -sp "..please create a Packagelist first!" echo -e "\n" exit 1 else if [ -f $DIR2/Release ]; then sums_1=$(md5sum "$DIR2/Packages" | cut -c1-32) #md5sum=32chars sums_2=$(md5sum "$DIR2/Packages.bz2" | cut -c1-32) sbytes_1=$(stat -c%s "$DIR2/Packages") sbytes_2=$(stat -c%s "$DIR2/Packages.bz2") echo "MD5Sum:" >> $DIR2/Release echo " $sums_1 $sbytes_1 $DIR6/Packages" >> $DIR2/Release echo " $sums_2 $sbytes_2 $DIR6/Packages.bz2" >> $DIR2/Release echo "" >> $DIR2/Release #essential newline else echo -e "\n\a[ERROR!] there is no Release file in $DIR2" read -sp "..so nothing wrote to it!" echo -e "\n..please create a Release file first and then run me again!" sleep 2 exit 1 fi fi if [ -f $DIR2/Release ]; then echo -e "\nI assume you already created your GPG-key..\n" sleep 1 gpg -abs -o $DIR2/Release.gpg $DIR2/Release echo -e "\n" read -sp "[DONE!] Packagelist signed successfull!" else echo -e "\n\a[ERROR!] There is no Release file in $DIR2" echo "..so nothing signed!" fi ;; 5|ftp|FTP) ftpupload() { #==========EDIT BELOW==========# SERVER= USERNAME= PASSWORD= REMOTEDIR= #=========STOP EDITING=========# FTP="/usr/bin/ncftpput" for FILE in $DIR2/*; do if [ ! "$FILE" = "$DIR2/*" ]; then $FTP -m -R -u $USERNAME -p $PASSWORD $SERVER $REMOTEDIR $FILE else echo -e "\n\a[ERROR!] no folders in $DIR2" read -sp "so nothing uploaded!" fi read -sp "[DONE!] all files in folder $DIR2 uploaded!" done } if [ -f /usr/bin/ncftpput ]; then ftpupload else echo -e "\n\a[ERROR!] ncftpput not installed!" read -p "..do you want me to download it? [Y/N] " choice_6 case "$choice_6" in yes|YES|y|Y) aptitude -y install ncftp echo -e "\n..retrying now...\n" ftpupload #try now.. ;; no|NO|n|N) echo -e "\n ..please download ncftpput manually!" echo "..exiting now!" sleep 2 exit 1 ;; *) echo -e "\nsorry, but "$choice_6" is not a valid answer to my question!" read -sp "..please try again!" ;; esac fi ;; e|exit|E|EXIT) exit 0;; gpg|GPG) echo -e "\n======================================================= \a [WARNING!] MAKE SURE YOU KNOW WHAT YOUR DOING! =======================================================" read -sp "..otherwise please press CTRL+C to cancel now!!" echo -e "\nCreating a GPGkey | ($(echo 'http://www.gnupg.org/' | tr q m))" read -p " ..do you want to create one?.. [Y/N] " choice_3 case "$choice_3" in yes|YES|y|Y) echo -e "\n..this step may take a little bit longer..\n" sleep 1 gpg --gen-key #create GPGkey echo -e "\n..GPG key created!" read -p "do you want to create a pubkey of this GPGkey? [Y/N] " choice_4 case "$choice_4" in yes|YES|y|Y) echo -e "\n..befor we start I need to know the name you choosed for your GPGkey" echo -e "\a\n[WARNING!] make sure you write the name case sensitive!!\n" read -p "what is the name of your GPGkey? " youNAME read -p "you selected "$youNAME" - is this correct? [Y/N] " choice_5 case "$choice_5" in yes|YES|y|Y) echo -e "\nOK - lets start..." gpg --armor --output $youNAME.pub --export '$youNAME' cp ./$youNAME.pub ~/cydia read -sp "[DONE!] your pubkey is copied to $HOME/cydia" ;; no|NO|n|N) echo -e "\n..I need to restart to give you another try - thx! -.-" sleep 3 exit 1 ;; *) echo -e "\nsorry, but "$choice_5" is not a valid answer to my question!" read -sp "..please try again!" ;; esac ;; no|NO|n|N) echo -e "\nOK - you need to manually make a pubkey using:" read -sp " gpg --armor --output KEYNAME.pub --export '-YOURNAMEHERE-'" ;; *) echo -e "\nsorry, but "$choice_4" is not a valid answer to my question!" read -sp "..please try again!" ;; esac ;; no|NO|n|N) echo -e "\n ..create your own GPG key using 'gpg --gen-key'" echo "..exiting now!" sleep 3 exit 1 ;; *) echo -e "\nsorry, but "$choice_3" is not a valid answer to my question!" read -sp "..please try again!" ;; esac ;; *) echo -e "\n\a[OOOPS!] Sorry $USER ["$answer"] is not valid!" read -sp "..please try again!" ;; esac done #gn8
|
| Return to
bash category list |
|
|
Who Visited EnigmaGroup Today?
1585 Guests, 266 Users (185 Spiders)
hkevin, unicornrainbow, Hessesian, ArcAvenger, GothicLogic, JohnMalkovitzch, ddxc, 3ntr0py, flarornEral, suetekh, whisperer, batsbargy, strudels, Rex_Mundi, limited, Rik, hackaday, nmobin27, whoami, Caddyamilla, NIGHTWOLF, dark_void, Cockelala, Xendz, trueorfalse, Klosse, Blavatsky, InjectioN, Bumpadjuppy, DrOptix, blackknight911, Effomeidonize, Distorted, TheHarrisonW, Obop, ellisp, Vreality2007, advenlydent, zach, Vengeance987, m0rt, 2345, electro-technic, riesenjoe, IvanDimitriev, RomeoG, timetrust, 2142, BillTuer, advilapyday, lotato, lonely.connection, CloverCipher, vnd, aurena, rospark, valy1177, learning, st3alth, Partisan, K0gller, fitz, Jayjay, psychomarine, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, Sir D. Naut, Macabre, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, Nikhil, evjfvir967nj, Mod777, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, m4f10, avacraft, becool, thecoder, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful |
| |
|
|
|
|
|