h8rt3rmin8r

nova-install-beta

Jun 18th, 2018
202
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. ################################################################################
  3. #  Install Nova Calculator - Build 2  #
  4. #  BETA                               #
  5. #######################################
  6.  
  7. #   CORE VARIABLES   #----------------------------------------------------------
  8.  
  9. TODAY="`date '+%Y%m%d' | head -c -1`"
  10. NOW="`date '+%Y%m%d-%H%M%S' | head -c -1`"
  11. USER=$(cd; pwd | cut -c 7-)
  12. HOME="/home/${USER}"
  13. CURL="curl -s "
  14.  
  15. #   SOURCE CODE LOCATION VARIABLES   #------------------------------------------
  16.  
  17. ROOT_A="https://pastebin.com/raw/"
  18. SOURCES_LIST="https://pastebin.com/raw/xUSH6vky"
  19. LBIN="/usr/local/bin/"
  20.  
  21. # FUNCTION: Download all source code
  22. download_sources() {
  23.  
  24.     # Download source code from sources list
  25.     ${CURL}${ROOT_A}xUSH6vky | wget -i -
  26.    
  27.     # Rename all code files and translate to unix from dos
  28.     mv 2QCVgMiE ${LBIN}nova-source/README
  29.     dos2unix -q -k -o ${LBIN}nova-source/README
  30.     mv 61fHwRCC ${LBIN}nova-source/install.sh
  31.     dos2unix -q -k -o ${LBIN}nova-source/install.sh
  32.     mv 7g2Se1h1 ${LBIN}nova-source/funcs.bc
  33.     dos2unix -q -k -o ${LBIN}nova-source/funcs.bc
  34.     mv 8DtHjWTi ${LBIN}nova-source/LICENSE
  35.     dos2unix -q -k -o ${LBIN}nova-source/LICENSE
  36.     mv gvbut3Qc ${LBIN}nova-source/nova.py
  37.     dos2unix -q -k -o ${LBIN}nova-source/nova.py
  38.     mv jKq3kL3m ${LBIN}nova-source/PRINT
  39.     dos2unix -q -k -o ${LBIN}nova-source/PRINT
  40.     mv qrsXBtzV ${LBIN}nova
  41.     dos2unix -q -k -o ${LBIN}nova
  42.     mv sbWkYVMX ${LBIN}nova-source/VERSIONS
  43.     dos2unix -q -k -o ${LBIN}nova-source/VERSIONS
  44.     mv y8d8d0Bg ${LBIN}nova-source/install-nova.sh
  45.     dos2unix -q -k -o ${LBIN}nova-source/install-nova.sh
  46.    
  47.     # Enable execution
  48.     sudo chmod +x ${LBIN}nova
  49.     sudo chmod +x ${LBIN}nova-source/nova.py
  50.     sudo chmod +x ${LBIN}nova-source/install.sh
  51.     sudo chmod +x ${LBIN}nova-source/install-nova.sh    
  52. }
  53.  
  54.  
  55. ################################################################################
  56.  
  57. # Verify root access
  58. uid=`id -u $USERNAME`
  59.  
  60. if [ "$uid" == "0" ]
  61.     then
  62.         echo ""
  63.         echo "INSTALL: User is root"
  64.         echo "         Beginning installation process..."
  65.         echo ""
  66.     else
  67.         echo "INSTALL: You need to have root access, run again with 'sudo'"
  68.     exit 1
  69. fi
  70. echo ""
  71. echo ${NOW}" -- Installation process started..."
  72. echo ""
  73.  
  74. # Update the package list and install system updates
  75. apt-get update
  76. apt-get -y dist-upgrade
  77.  
  78. # INSTALL: curl
  79. apt-get install -y curl
  80. # INSTALL: wget
  81. apt-get install -y wget
  82. # INSTALL: dos2unix
  83. apt-get install -y dos2unix
  84. # INSTALL: neofetch
  85. apt-get install -y neofetch
  86. # INSTALL: unzip
  87. apt-get install -y unzip
  88. # INSTALL: jq
  89. apt-get install -y jq
  90.  
  91. # Update the package list
  92. apt-get update
  93.  
  94. # Setup core files and construct directories
  95. cd ${HOME}/
  96.  
  97. mkdir -p ${HOME}/.software/nova
  98. rm -rf ${HOME}/.software/nova
  99. mkdir -p ${HOME}/.software/nova/{sources,logs}
  100. touch ${HOME}/.software/nova/logs/${TODAY}.log
  101. mkdir -p /usr/local/bin/nova-source
  102. rm -rf /usr/local/bin/nova-source
  103. mkdir -p /usr/local/bin/nova-source
  104. touch /usr/local/bin/nova
  105. rm /usr/local/bin/nova
  106. touch /usr/local/bin/nova
  107. cd ${HOME}/.software/nova/sources
  108.  
  109. # Download the nova-calculator source code
  110. download_sources
  111.  
  112. # Transfer ownership and exit installation script
  113. echo ${TODAY}" -- Installation complete!" > ${HOME}/.software/nova/logs/${TODAY}.log
  114. echo ""
  115. echo ${NOW}" -- Installation complete!"
  116. echo ""
  117. nova -h
  118. sudo chown -R ${USER}:${USER} ${HOME}/.software/
  119. sudo chown -R ${USER}:${USER} /usr/local/bin/nova-source
  120.  
  121. exit
  122.  
  123. ################################################################################
  124.                                                    #                           #
  125.                                                    #  "think outside the box"  #
  126.                                                    #                           #
  127.                                                    #    ($) ¯\_(ツ)_/¯ (฿)     #
  128.                                                    #                           #
  129.                                                    #############################
RAW Paste Data