Advertisement
Guest User

Untitled

a guest
Dec 21st, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. WHO=$(whoami)
  6.  
  7. if [ ${WHO} == "root" ]
  8.  
  9. then
  10.  
  11. echo "Script Initialized ..."
  12.  
  13. else
  14.  
  15. echo "You must be logged in as root to install ionCube Loader."
  16.  
  17. echo "Terminating ..."
  18.  
  19. exit 0
  20.  
  21. fi
  22.  
  23.  
  24.  
  25. cd /usr/local/
  26.  
  27.  
  28.  
  29. if [ -e ioncube_loaders_lin_x86.tar.gz ] || [ -e ioncube_loaders_lin_x86-64.tar.gz ]
  30.  
  31. then
  32.  
  33. rm -f ioncube_loaders_lin_x86.tar.gz
  34.  
  35. rm -f ioncube_loaders_lin_x86-64.tar.gz
  36.  
  37. fi
  38.  
  39.  
  40.  
  41. if [ `getconf LONG_BIT` = "64" ]
  42. then
  43.  
  44.   # 64-bit stuff here
  45.  
  46. wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
  47.  
  48. else
  49.  
  50.   # 32-bit stuff here
  51.  
  52. wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
  53.  
  54. fi
  55.  
  56.  
  57.  
  58. if [ `getconf LONG_BIT` = "64" ]
  59. then
  60.  
  61.   # 64-bit stuff here
  62.  
  63. tar -zxvf ioncube_loaders_lin_x86-64.tar.gz
  64.  
  65. else
  66.  
  67.   # 32-bit stuff here
  68.  
  69. tar -zxvf ioncube_loaders_lin_x86.tar.gz
  70.  
  71. fi
  72.  
  73.  
  74.  
  75. chown -R root.root ioncube
  76.  
  77.  
  78.  
  79. phpline=`php -v | grep ^PHP | cut -f2 -d " "| awk -F "." '{print "zend_extension=\"/usr/local/ioncube/ioncube_loader_lin_"$1"."$2".so\""}'`
  80.  
  81. phpinifile=`php -i | grep php.ini | grep ^Configuration | cut -f6 -d" "`
  82.  
  83.  
  84.  
  85. echo "Adding line $phpline to file $phpinifile"
  86.  
  87. echo "$phpline" >> $phpinifile
  88.  
  89.  
  90.  
  91. if [ `getconf LONG_BIT` = "64" ]
  92. then
  93.  
  94.   # 64-bit stuff here
  95.  
  96. rm -f ioncube_loaders_lin_x86-64.tar.gz
  97.  
  98. else
  99.  
  100.   # 32-bit stuff here
  101.  
  102. rm -f ioncube_loaders_lin_x86.tar.gz
  103.  
  104. fi
  105.  
  106.  
  107.  
  108. echo "Ioncube installed sucessfully"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement