Votre Nom il y a 1 an
Parent
commit
7ce9b89f6c
3 fichiers modifiés avec 58 ajouts et 1 suppressions
  1. 57 0
      options/wireguard.sh
  2. 1 0
      pack/.gitignore
  3. 0 1
      pack/clean.sh

+ 57 - 0
options/wireguard.sh

@@ -0,0 +1,57 @@
+#!/bin/bash
+version=1.0
+function print_centered {
+     [[ $# == 0 ]] && return 1
+     declare -i TERM_COLS="$(tput cols)"
+     declare -i str_len="${#1}"
+     [[ $str_len -ge $TERM_COLS ]] && {
+          echo "$1";
+          return 0;
+     }
+     declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
+     [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
+     filler=""
+     for (( i = 0; i < filler_len; i++ )); do
+          filler="${filler}${ch}"
+     done
+     printf "%s%s%s" "$filler" "$1" "$filler"
+     [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
+     printf "\n"
+     return 0
+}
+function intro_ {
+print_centered "$(tput setaf 2)"
+print_centered " _ _ _ _                           _ "
+print_centered "| | | |_|___ ___ ___ _ _ ___ ___ _| |"
+print_centered "| | | | |  _| -_| . | | | .'|  _| . |"
+print_centered "|_____|_|_| |___|_  |___|__,|_| |___|"
+print_centered "                |___|                "
+echo -n "$(tput sgr0)"
+print_centered "Wireguard VPN serveur v$version"
+print_centered ""
+}
+
+function install_ {
+if grep "#net.ipv4.ip_forward=1" /etc/sysctl.conf >/dev/null
+then
+cp /etc/sysctl.conf /tmp/
+chmod 777 /tmp/sysctl.conf
+sed -i "s/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g" /tmp/sysctl.conf
+chmod 600 /tmp/sysctl.conf
+sudo cp /tmp/sysctl.conf /etc/sysctl.conf
+print_centered "Install sysctl.conf : [ OK ]"
+fi
+sudo apt install wireguard -y
+clear
+intro_
+print_centered "Install soft   : [ OK ]"
+sudo cp /Cloud/wireguard.tar.xz /
+sudo tar xfJ /wireguard.tar.xz
+sudo rm /wireguard.tar.xz
+print_centered "Install config : [ OK ]"
+sudo systemctl enable wg-quick@wg0.service
+sudo systemctl start wg-quick@wg0.service
+print_centered "Start software : [ OK ]"
+}
+
+install_

+ 1 - 0
pack/.gitignore

@@ -10,3 +10,4 @@ gpu-miners.tar.xz
 amdgpu-install_22.20.50200-1_all.deb
 flexfarmer.tar.xz
 chia-x-proxy.tar.xz
+wireguard.tar.xz

+ 0 - 1
pack/clean.sh

@@ -16,7 +16,6 @@ if [ -f gpu-miners.tar.xz ]; then sudo rm gpu-miners.tar.xz;fi
 if [ -f flexfarmer.tar.xz ]; then sudo rm flexfarmer.tar.xz;fi
 if [ -f cuda_11.8.0_520.61.05_linux.run ];then sudo rm cuda_11.8.0_520.61.05_linux.run;fi
 if [ -f chia-x-proxy.tar.xz ]; then sudo rm chia-x-proxy.tar.xz;fi
-
 Webmin=$(grep "Webmin=" ../build_cube.sh  | cut -d '"' -f 2)
 if [ -f $Webmin.tar.xz ];then sudo rm $Webmin.tar.xz;fi
 echo "Done"