Yam Code
Sign up
Login
New paste
Home
Trending
Archive
English
English
Tiếng Việt
भारत
Sign up
Login
New Paste
Browse
#!/bin/bash INFO="\e[96m" SUCCESS="\e[92m" YELLOW="\e[33m" BOLD="\e[1m" RESET="\e[0m" DOTTED="\e[5m" NGINX_SHARE="./usr/share/nginx/html" LETSENCRYPT_DIR="/opt/letsencrypt" function is_installed() { # set to 1 initially local return_=1 # set to 0 if not found type $1 >/dev/null 2>&1 || { local return_=0; } # return echo "$return_" } function is_yes() { local return_=1 if [[ "$1" == "${1#[Yy]}" && ! -z "$1" ]]; then local return_=0 else local return_=1 fi echo "$return_" } function install_vps() { read -r -p "$(echo -e $BOLD$YELLOW"Do you want to start the installation process $INFO[Y/n]: "$RESET)" start if [ "$(is_yes $start)" == "1" ]; then echo -e $INFO"Updating VPS..." apt-get update echo -e "Install [Nodejs|Server|Nginx|Redis|Postgreshql] - Ubuntu System"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install nginx $INFO[Y/n]: "$RESET)" nginx if [[ "$(is_installed nginx)" == "0" && "$(is_yes $nginx)" == "1" ]]; then echo -e $INFO"Installing nginx..." apt-get install nginx -y echo -e "Start nginx..." systemctl start nginx echo -e "Auto enable nginx when server reboot..."$RESET systemctl enable nginx echo -e $SUCCESS"Nginx install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install make $INFO[Y/n]: "$RESET)" make if [[ "$(is_installed make)" == "0" && "$(is_yes $make)" == "1" ]]; then echo -e $INFO"Installing build-essential..."$RESET apt-get install build-essential -y echo -e $SUCCESS"Make install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install nodejs-v13 $INFO[Y/n]: "$RESET)" nodejs if [[ "$(is_installed node)" == "0" && "$(is_yes $nodejs)" == "1" ]]; then echo -e $INFO"Download nodejs 13..." curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - echo -e "Installing nodejs..."$RESET apt-get install nodejs -y node --version echo -e $SUCCESS"Nodejs install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install git $INFO[Y/n]: "$RESET)" git if [[ "$(is_installed git)" == "0" && "$(is_yes $git)" == "1" ]]; then echo -e $INFO"Installing git..."$RESET apt-get install git -y echo -e $SUCCESS"Git install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install pm2 $INFO[Y/n] "$RESET)" pm2 if [[ "$(is_installed pm2)" == "0" && "$(is_yes $pm2)" == "1" ]]; then echo -e $INFO"Installing pm2..."$RESET npm i -g pm2 echo -e $SUCCESS"PM2 install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install redis $INFO[Y/n] "$RESET)" redis if [[ "$(is_installed redis-cli)" == "0" && "$(is_yes $redis)" == "1" ]]; then echo -e $INFO"Installing redis..."$RESET apt-get install redis-server echo -e $SUCCESS"Redis install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install postgresql $INFO[Y/n] "$RESET)" postgresql if [[ "$(is_installed postgresql)" == "0" && "$(is_yes $postgresql)" == "1" ]]; then echo -e $INFO"Installing postgresql..."$RESET apt-get install postgresql -y echo -e $SUCCESS"PostGresql install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want install postgresql contrib $INFO[Y/n] "$RESET)" postgresql_contrib if [[ "$(is_installed postgresql-contrib)" == "0" && "$(is_yes $postgresql_contrib)" == "1" ]]; then echo -e $INFO"Installing postgresql-contrib"$RESET apt-get install postgresql-contrib -y echo -e $SUCCESS"PostGresql contrib install sucess"$RESET fi read -r -p "$(echo -e $BOLD$YELLOW"Install letsencrypt SSL : "$RESET)" ssl if [ "$(is_yes $ssl)" == "1" ]; then if [ ! -d "$LETSENCRYPT_DIR" ]; then git clone https://github.com/letsencrypt/letsencrypt $LETSENCRYPT_DIR fi fi echo -e $BOLD$SUCCESS"Install VPS success"$RESET } function setup_project() { read -r -p "$(echo -e $BOLD$YELLOW"Do you want to start setup project $INFO[Y/n]: "$RESET)" setup if [ "$(is_yes $setup)" == "1" ]; then echo -e $INFO"hihi"$RESET read -r -p "$(echo -e $BOLD$YELLOW"Git repo: "$RESET)" repo cd $NGINX_SHARE && git clone $repo fi read -r -p "$(echo -e $BOLD$YELLOW"Do you want setup domain ssl $INFO[Y/n]: "$RESET)" setup_ssl if [ "$(is_yes $setup_ssl)" == "1" ]; then /opt/letsencrypt/certbot-auto certonly --standalone fi } install_vps setup_project
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Tiếng Việt
भारत