Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- LOGFILE=$(pwd)"/gns3_install.log"
- touch $LOGFILE
- #Install all dependencies first
- function gns3_deps {
- echo $(date +'%m-%d-%y %T') "[ ] Installing dependencies for GNS3" >> $LOGFILE
- sudo apt-get install -y libpcap-dev uuid-dev libelf-dev cmake python3-setuptools python3-pyqt4 python3-ws4py python3-netifaces python3-zmq python3-tornado && echo $(date +'%m-%d-%y %T') "[+] GNS 3 Dependencies successfully instaled" >> $LOGFILE || echo $(date +'%m-%d-%y %T') "[-] GNS3 Dependencies Failed to install" >> $LOGFILE
- }
- function install_virtualbox {
- echo $(date +'%m-%d-%y %T') "[ ] Installing Virtualbox and Dependencies" >> $LOGFILE
- sudo apt-get install -y virtualbox-dkms dkms && sudo apt-get install -y virtualbox && echo $(date +'%m-%d-%y %T') "[+] Virtualbox successfully instaled" >> $LOGFILE || echo $(date +'%m-%d-%y %T') "[-] Virtualbox Failed to install" >> $LOGFILE
- }
- #Then get all the packages required
- function build_dirs {
- cd ~ && mkdir gns3
- }
- function install_dynamips {
- echo $(date +'%m-%d-%y %T') "[ ] Installing Dynamips" >> $LOGFILE
- cd ~/gns3
- wget https://github.com/GNS3/dynamips/archive/v0.2.14.tar.gz
- tar -xvzf v0.2.14.tar.gz
- cd dynamips-0.2.14
- mkdir build && cd build
- cmake ..&& echo $(date +'%m-%d-%y %T') "[+] Completed Cmake " >> $LOGFILE || echo $(date +'%m-%d-%y %T') "[-] Dynamips Cmake failed " >> $LOGFILE
- make && sudo make install && echo $(date +'%m-%d-%y %T') "[+] Dynamips sucessfully built " >> $LOGFILE || echo $(date +'%m-%d-%y %T') "[-] Dynamips failed to build " >> $LOGFILE
- echo $(date +'%m-%d-%y %T') "[+] Successfully installed Dynamips" >> $LOGFILE
- }
- function install_gns3_server {
- echo $(date +'%m-%d-%y %T') "[ ] Installing GNS3 Server" >> $LOGFILE
- cd ~/gns3
- wget https://github.com/GNS3/gns3-server/archive/v1.1.tar.gz
- mv v1.1.tar.gz gns3-server-v1.1.tar.gz
- tar -xvzf gns3-server-v1.1.tar.gz
- cd gns3-server-1.1
- sudo python3 setup.py install
- echo $(date +'%m-%d-%y %T') "[+] Successfully installed GNS3 Server" >> $LOGFILE
- }
- function install_gns3_gui {
- echo $(date +'%m-%d-%y %T') "[ ] Installing GNS3 GUI" >> $LOGFILE
- cd ~/gns3
- wget https://github.com/GNS3/gns3-gui/archive/v1.1.tar.gz
- mv v1.1.tar.gz gns3-gui-v1.1.tar.gz
- tar -xvzf gns3-gui-v1.1.tar.gz
- cd gns3-gui-1.1
- sudo python3 setup.py install
- echo $(date +'%m-%d-%y %T') "[+] Successfully installed GNS3 GUI" >> $LOGFILE
- }
- gns3_deps
- install_virtualbox
- build_dirs
- install_dynamips
- install_gns3_server
- install_gns3_gui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement