Advertisement
NilsRapilly

Fusion.sh(BTS SIO)

Dec 18th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.53 KB | None | 0 0
  1. #!/bin/bash
  2. ####### Written By Nils Rapilly
  3. ####### Fully functionnal Fusion inventory installer
  4. #
  5. #
  6. ################################################################################
  7. #color headers
  8. RED='\033[1;31m'
  9. BLUE='\033[1;34m'
  10. YELLOW='\033[1;33m'
  11. PURPLE='\033[1;35m'
  12. WHITE='\033[1;37m'
  13. GREY='\033[1;30m]'
  14. NC='\033[0m'
  15. ################################################################################
  16.                   #        CORE
  17. function gosudo {
  18.   #you need to be super user to use the script, we enable this here
  19.   sudo su
  20. }
  21.  
  22. function sourcemod {
  23.   #modify source.list with echo append and update
  24.   echo "deb https://gist.github.com/jackw1111/d31140946901fab417131ff4d9ae92e3 main non-free" >> /etc/apt/sources.list
  25.   apt-get update
  26.  
  27. }
  28. function install {
  29.   #install agent
  30.   apt-get install fusioninventory-agent fusioninventory-agent-task-network fusioninventory-agent-task-esx fusioninventory-agent-task-deploy
  31.   #enable perl https
  32.   perl -MCPAN -e "install LWP::Protocol::https"
  33. }
  34.  
  35. function cfginject {
  36.   echo "entrez l'adresse IP du serveur FusionInventory"
  37.   read -p 'Server :' ipserver
  38.   #inject  echo into cfg it will be created if not already present
  39.   echo "no-task = deploy" >> /etc/fusioninventory/agent.cfg
  40.   echo 'server = https://'$ipserver'/plugins/fusioninventory/' >> /etc/fusioninventory/agent.cfg
  41.   echo "scan-homedirs = 1" >> /etc/fusioninventory/agent.cfg 
  42.   echo "user = tech" >> /etc/fusioninventory/agent.cfg
  43.   echo "password=mptech" >> /etc/fusioninventory/agent.cfg
  44.   echo "no-ssl-check = 1" >> /etc/fusioninventory/agent.cfg
  45.   echo "httpd-id  = $ipserver" >> /etc/fusioninventory/agent.cfg
  46.   #i dont know what's the line below is supposed to do, hence, vanilla
  47.   echo "httpd-trust = 172.20.0.0/16" >> /etc/fusioninventory/agent.cfg
  48.  
  49. }
  50. function runagent {
  51.   #run it and open GLPI
  52.   fusioninventory-agent
  53. }
  54.  
  55. #################MAIN
  56. function main {
  57.   #decorate
  58.   banner
  59.   #core
  60.   sourcemod
  61.   install
  62.   cfginject
  63.   runagent
  64.  
  65.   echo "We're all Done now :)"
  66.  
  67.  
  68. }
  69.  
  70. ################################################################################
  71.                   #        FUSIONT [Decorate]
  72. ################################################################################
  73.  
  74.  
  75. function banner {
  76.  
  77. echo ""
  78. echo -e "                                                          ${BLUE}  Time Saver Script ${NC}"
  79. echo -e "                                                                        "
  80. echo -e "     ${WHITE}
  81.          ███████╗██╗   ██╗███████╗██╗ ██████╗ ███╗   ██╗   ███████╗██╗  ██╗
  82.          ██╔════╝██║   ██║██╔════╝██║██╔═══██╗████╗  ██║   ██╔════╝██║  ██║
  83.          █████╗  ██║   ██║███████╗██║██║   ██║██╔██╗ ██║   ███████╗███████║
  84.          ██╔══╝  ██║   ██║╚════██║██║██║   ██║██║╚██╗██║   ╚════██║██╔══██║
  85.          ██║     ╚██████╔╝███████║██║╚██████╔╝██║ ╚████║██╗███████║██║  ██║
  86.          ╚═╝      ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝╚══════╝╚═╝  ╚═╝
  87.  
  88. ${NC} "
  89. echo ""
  90. echo -e "                                                               ${YELLOW} version : ${WHITE} 1.0 ${NC}         "
  91. echo -e "                                                         ${YELLOW}    Codename :${WHITE} Cold Fire 500c ${NC}         "
  92. echo -e "                                                                 ${YELLOW}Glpi ${WHITE} based ${NC} "
  93. echo -e "                                                             ${YELLOW} Written by${NC} ${WHITE} Nils Rapilly ${NC}"
  94. echo "                                                       "
  95. echo ""
  96. echo ""
  97. }
  98. function loader {
  99.   echo -ne '                        [##                             ]\r'
  100.   sleep 0.07
  101.   echo -ne '                        [####                           ]\r'
  102.   sleep 0.07
  103.   echo -ne '                        [######                         ]\r'
  104.   sleep 0.07
  105.   echo -ne '                        [########                       ]\r'
  106.   sleep 0.07
  107.   echo -ne '                        [##########                     ]\r'
  108.   sleep 0.07
  109.   echo -ne '                        [############                   ]\r'
  110.   sleep 0.07
  111.   echo -ne '                        [##############                 ]\r'
  112.   sleep 0.07
  113.   echo -ne '                        [################               ]\r'
  114.   sleep 0.07
  115.   echo -ne '                        [##################             ]\r'
  116.   sleep 0.07
  117.   echo -ne '                        [####################           ]\r'
  118.   sleep 0.07
  119.   echo -ne '                        [######################         ]\r'
  120.   sleep 0.07
  121.   echo -ne '                        [########################       ]\r'
  122.   sleep 0.07
  123.   echo -ne '                        [##########################     ]\r'
  124.   sleep 0.07
  125.   echo -ne '                        [#############################  ]\r'
  126.   sleep 0.07
  127.   echo -ne '                        [###############################]\r'
  128.   sleep 0.4
  129. }
  130. ################################################################################
  131.   main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement