Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ####### Written By Nils Rapilly
- ####### Fully functionnal Fusion inventory installer
- #
- #
- ################################################################################
- #color headers
- RED='\033[1;31m'
- BLUE='\033[1;34m'
- YELLOW='\033[1;33m'
- PURPLE='\033[1;35m'
- WHITE='\033[1;37m'
- GREY='\033[1;30m]'
- NC='\033[0m'
- ################################################################################
- # CORE
- function gosudo {
- #you need to be super user to use the script, we enable this here
- sudo su
- }
- function sourcemod {
- #modify source.list with echo append and update
- echo "deb https://gist.github.com/jackw1111/d31140946901fab417131ff4d9ae92e3 main non-free" >> /etc/apt/sources.list
- apt-get update
- }
- function install {
- #install agent
- apt-get install fusioninventory-agent fusioninventory-agent-task-network fusioninventory-agent-task-esx fusioninventory-agent-task-deploy
- #enable perl https
- perl -MCPAN -e "install LWP::Protocol::https"
- }
- function cfginject {
- echo "entrez l'adresse IP du serveur FusionInventory"
- read -p 'Server :' ipserver
- #inject echo into cfg it will be created if not already present
- echo "no-task = deploy" >> /etc/fusioninventory/agent.cfg
- echo 'server = https://'$ipserver'/plugins/fusioninventory/' >> /etc/fusioninventory/agent.cfg
- echo "scan-homedirs = 1" >> /etc/fusioninventory/agent.cfg
- echo "user = tech" >> /etc/fusioninventory/agent.cfg
- echo "password=mptech" >> /etc/fusioninventory/agent.cfg
- echo "no-ssl-check = 1" >> /etc/fusioninventory/agent.cfg
- echo "httpd-id = $ipserver" >> /etc/fusioninventory/agent.cfg
- #i dont know what's the line below is supposed to do, hence, vanilla
- echo "httpd-trust = 172.20.0.0/16" >> /etc/fusioninventory/agent.cfg
- }
- function runagent {
- #run it and open GLPI
- fusioninventory-agent
- }
- #################MAIN
- function main {
- #decorate
- banner
- #core
- sourcemod
- install
- cfginject
- runagent
- echo "We're all Done now :)"
- }
- ################################################################################
- # FUSIONT [Decorate]
- ################################################################################
- function banner {
- echo ""
- echo -e " ${BLUE} Time Saver Script ${NC}"
- echo -e " "
- echo -e " ${WHITE}
- ███████╗██╗ ██╗███████╗██╗ ██████╗ ███╗ ██╗ ███████╗██╗ ██╗
- ██╔════╝██║ ██║██╔════╝██║██╔═══██╗████╗ ██║ ██╔════╝██║ ██║
- █████╗ ██║ ██║███████╗██║██║ ██║██╔██╗ ██║ ███████╗███████║
- ██╔══╝ ██║ ██║╚════██║██║██║ ██║██║╚██╗██║ ╚════██║██╔══██║
- ██║ ╚██████╔╝███████║██║╚██████╔╝██║ ╚████║██╗███████║██║ ██║
- ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝╚══════╝╚═╝ ╚═╝
- ${NC} "
- echo ""
- echo -e " ${YELLOW} version : ${WHITE} 1.0 ${NC} "
- echo -e " ${YELLOW} Codename :${WHITE} Cold Fire 500c ${NC} "
- echo -e " ${YELLOW}Glpi ${WHITE} based ${NC} "
- echo -e " ${YELLOW} Written by${NC} ${WHITE} Nils Rapilly ${NC}"
- echo " "
- echo ""
- echo ""
- }
- function loader {
- echo -ne ' [## ]\r'
- sleep 0.07
- echo -ne ' [#### ]\r'
- sleep 0.07
- echo -ne ' [###### ]\r'
- sleep 0.07
- echo -ne ' [######## ]\r'
- sleep 0.07
- echo -ne ' [########## ]\r'
- sleep 0.07
- echo -ne ' [############ ]\r'
- sleep 0.07
- echo -ne ' [############## ]\r'
- sleep 0.07
- echo -ne ' [################ ]\r'
- sleep 0.07
- echo -ne ' [################## ]\r'
- sleep 0.07
- echo -ne ' [#################### ]\r'
- sleep 0.07
- echo -ne ' [###################### ]\r'
- sleep 0.07
- echo -ne ' [######################## ]\r'
- sleep 0.07
- echo -ne ' [########################## ]\r'
- sleep 0.07
- echo -ne ' [############################# ]\r'
- sleep 0.07
- echo -ne ' [###############################]\r'
- sleep 0.4
- }
- ################################################################################
- main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement