Advertisement
Guest User

GNS3 1.1 installation script

a guest
Oct 30th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.61 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. LOGFILE=$(pwd)"/gns3_install.log"
  4. touch $LOGFILE
  5. #Install all dependencies first
  6. function gns3_deps {
  7.  
  8. echo $(date +'%m-%d-%y %T')  "[ ] Installing dependencies for GNS3" >> $LOGFILE
  9. 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
  10.  
  11. }
  12.  
  13. function install_virtualbox {
  14.  
  15. echo $(date +'%m-%d-%y %T')  "[ ] Installing Virtualbox and Dependencies" >> $LOGFILE
  16. 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
  17.  
  18. }
  19.  
  20. #Then get all the packages required
  21. function build_dirs {
  22.  
  23. cd ~ && mkdir gns3
  24.  
  25. }
  26.  
  27. function install_dynamips {
  28. echo $(date +'%m-%d-%y %T')  "[ ] Installing Dynamips" >> $LOGFILE
  29.         cd ~/gns3
  30.         wget https://github.com/GNS3/dynamips/archive/v0.2.14.tar.gz
  31.         tar -xvzf v0.2.14.tar.gz
  32.         cd dynamips-0.2.14
  33.         mkdir build && cd build
  34.         cmake ..&& echo $(date +'%m-%d-%y %T')  "[+] Completed Cmake " >> $LOGFILE || echo $(date +'%m-%d-%y %T')  "[-] Dynamips Cmake failed " >> $LOGFILE
  35.         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
  36. echo $(date +'%m-%d-%y %T')  "[+] Successfully installed Dynamips" >> $LOGFILE
  37.  
  38. }
  39.  
  40. function install_gns3_server {
  41. echo $(date +'%m-%d-%y %T')  "[ ] Installing GNS3 Server" >> $LOGFILE
  42.         cd ~/gns3
  43.         wget https://github.com/GNS3/gns3-server/archive/v1.1.tar.gz
  44.         mv v1.1.tar.gz gns3-server-v1.1.tar.gz
  45.         tar -xvzf gns3-server-v1.1.tar.gz
  46.         cd gns3-server-1.1
  47.         sudo python3 setup.py install
  48. echo $(date +'%m-%d-%y %T')  "[+] Successfully installed GNS3 Server" >> $LOGFILE
  49. }
  50.  
  51.  
  52. function install_gns3_gui {
  53. echo $(date +'%m-%d-%y %T')  "[ ] Installing GNS3 GUI" >> $LOGFILE
  54.         cd ~/gns3
  55.         wget https://github.com/GNS3/gns3-gui/archive/v1.1.tar.gz
  56.         mv v1.1.tar.gz gns3-gui-v1.1.tar.gz
  57.         tar -xvzf gns3-gui-v1.1.tar.gz
  58.         cd gns3-gui-1.1
  59.         sudo python3 setup.py install
  60. echo $(date +'%m-%d-%y %T')  "[+] Successfully installed GNS3 GUI" >> $LOGFILE
  61. }
  62.  
  63. gns3_deps
  64. install_virtualbox
  65. build_dirs
  66. install_dynamips
  67. install_gns3_server
  68. install_gns3_gui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement