Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #!/bin/bash
  2.  
  3. print_usage() {
  4. echo "Syntax:      $0 firstrun/newpackage/editpackage"
  5. echo
  6. echo "Usage Examples:-"
  7. echo
  8. echo "firstrun:    $0 firstrun"
  9. echo "revert:      $0 revert (if kyle fucks up)"
  10. echo "newpackage:  $0 newpackage packagename.zip Category Version \"Description\" (NOT IMPLEMENTED)"
  11. echo "editpackage: $0 editpackage packagename MaintainerName MaintainerEmail Category Version \"Description\" (NOT IMPLEMENTED)"
  12. }
  13.  
  14. repofile=installer.xml
  15.  
  16. repodesc="ModMyiFone.com"
  17.  
  18. first_run() {
  19. cd zips
  20. cat < /home/mmi/public_html/installer.xml | grep http | grep .zip|awk '{gsub("<string>","");gsub("</string>","");print}'| xargs wget -nc
  21. rm -rf ../unzipped
  22. mkdir -p ../unzipped
  23. cp -R ../scripts/* ../unzipped/
  24. for z in *.zip; do ../unzip -K -o -qq $z -d ../unzipped/`basename $z .zip|tr A-Z a-z`/; done
  25. cd ../unzipped/
  26.  
  27. python metadata.py $repofile
  28.  
  29. for x in *; do
  30.     if [ -d ${x}/__MACOSX ]; then
  31.         rm -rf ${x}/__MACOSX
  32.     fi
  33.  
  34.     if [ -d ${x}/DEBIAN ]; then
  35.         echo "" >> ${x}/DEBIAN/control
  36.         chmod +x ${x}/DEBIAN/*
  37.     fi
  38.  
  39.     if [ -e ${x}/test.txt ]; then
  40.         rm -f ${x}/test.txt
  41.     fi
  42. done
  43.  
  44. mkdir -p /home/mmi/repo2/debs
  45.  
  46. if [ ! -d /home/mmi/repo2/ ]; then
  47. exit 1
  48. fi
  49.  
  50. mv mpkgs /home/mmi/repo2/mpkgs
  51.  
  52. for x in *; do mv "`ls -d ${x} | grep -wv repo | grep -v .py | grep -v .xml`" /home/mmi/repo2/debs/; done
  53.  
  54. cd /home/mmi/repo2/debs
  55.  
  56. find . -name '.DS_Store' -exec rm -rf {} \; -prune
  57.  
  58. for x in *; do
  59.     dpkg-deb -b $x 1>/dev/null 2>/dev/null
  60. #   rm -rf $x
  61. done
  62.  
  63. cp -pR /home/mmi/edebs/* ./
  64.  
  65. cd ..
  66.  
  67. mkdir -p indices
  68.  
  69. touch indices/override.stable.main
  70.  
  71. mkdir -p dists/stable/main/binary-darwin-arm
  72.  
  73. cat<<END>dists/stable/Release
  74. Origin: stable
  75. Label: ModMyiFone
  76. Suite: stable
  77. Version: 1.2
  78. Codename: stable
  79. Architectures: darwin-arm
  80. Components: main
  81. Description: ${repodesc}
  82. MD5Sum:
  83.  
  84. END
  85.  
  86. chmod +x mpkgs
  87.  
  88. ./mpkgs debs indices/override.stable.main | awk '{gsub("Section: Network","Section: Networking");print}'| gzip -9 - -c > dists/stable/main/binary-darwin-arm/Packages.gz
  89.  
  90. for file in dists/stable/main/binary-darwin-arm/{Packages.gz}; do echo " $(md5sum "${file}" | cut -d ' ' -f 1) $(du -b "${file}" | cut -d $'\t' -f 1) ${file}"; done >>dists/stable/Release
  91.  
  92. mkdir -p conf
  93.  
  94. cat<<END>conf/distributions
  95. Origin: stable
  96. Label: ModMyiFone
  97. Suite: stable
  98. Codename: stable
  99. Architectures: darwin-arm
  100. Components: main
  101. Description: ${repodesc}
  102. END
  103.  
  104. if [ -d private/ ]; then
  105.     rm -rf private
  106. fi
  107.  
  108. cd /home/mmi/
  109. rm -rf /home/mmi/backup_repo
  110. mkdir -p /home/mmi/backup_repo
  111. cp -pR /home/mmi/public_html/repo/* /home/mmi/backup_repo/
  112. rm -rf /home/mmi/public_html/repo
  113. mkdir -p /home/mmi/public_html/repo
  114. cp -pR /home/mmi/repo2/* /home/mmi/public_html/repo/
  115. rm -rf /home/mmi/repo2
  116. mkdir -p /home/mmi/repo2
  117. }
  118.  
  119. run_revert() {
  120. mkdir -p /home/mmi/reverted_repo
  121. cp -pR /home/mmi/public_html/repo/* /home/mmi/reverted_repo
  122. rm -rf /home/mmi/public_html/repo
  123. mkdir -p /home/mmi/public_html/repo
  124. cp -pR /home/mmi/backup_repo/* /home/mmi/public_html/repo/
  125. rm -rf /home/mmi/backup_repo
  126. mkdir -p /home/mmi/backup_repo
  127. }
  128.  
  129. case $1 in
  130.     --usage ) print_usage ;;
  131.     firstrun ) first_run ;;
  132.     newpackage ) new_package ;;
  133.     editpackage ) edit_package ;;
  134.     revert ) run_revert ;;
  135.     "" ) print_usage ;;
  136. esac
  137.  
  138. corrupted_control(){
  139. for c in *; do rm -f ${c}/DEBIAN/control; done
  140. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top