Advertisement
gotsalyuk

test.sh

Dec 7th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.40 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ####Конфиг для Centos 7 под MVC.NetCore с предустановленным рецептом lamp#####
  4.     yum update -y
  5.     yum upgrade -y
  6.     yum install epel-release
  7.     yum install whois -y
  8.  
  9. #
  10. ####увелечение сессии ssh на время настройки
  11.     echo '
  12.  
  13.    ### my config
  14.    TCPKeepAlive yes
  15.    ClientAliveInterval 60
  16.    ClientAliveCountMax 180
  17.  
  18.    ' >> /etc/ssh/sshd_config
  19.  
  20.     service sshd restart
  21. #
  22. #### on client if not exists
  23.     #
  24.     #sudo echo '
  25.     #
  26.     #ClientAliveInterval 60
  27.     #ClientAliveCountMax 180
  28.     #' >> ~/.ssh/config
  29.     #
  30. #
  31. ####гит
  32.     ###yum install git -y
  33.     ###echo 'set global user.name'
  34.     ###read text
  35.     ###git --config global user.name "$text"
  36.     ###echo 'set global user.email'
  37.     ###read text
  38.     ###git --config global user.email "$text"
  39.     ###echo -n
  40.     ###'
  41.     ###Добавить авторизацию по ssh (y/n)
  42.     ###
  43.     ###
  44.     ###
  45.     ###'
  46.     ###read text
  47.     ###
  48.     ###if [ "$text" == "y" ]; then
  49.     ###
  50.     ###ssh-keygen ; eval `ssh-agent`
  51.     ###echo 'укажите имя приватного ключа'
  52.     ###read text
  53.     ###ssh-add ~/.ssh/$text
  54.     ###r=$(cat ~/.ssh/$text.pub)
  55.     ###echo -n
  56.     ###'
  57.     ###
  58.     ###
  59.     ###
  60.     ###
  61.     ###$r
  62.     ###
  63.     ###
  64.     ###
  65.     ###
  66.     ###
  67.     ###
  68.     ###
  69.     ###'
  70.     ###
  71.     ###echo 'добавьте ключ в гит репозиторий, по окончанию нажмите любую клавишу'
  72.     ###read text
  73.     ###ssh -T git@bitbucket.org
  74.     ###
  75.     ###fi
  76.     ###
  77.     ###
  78.     ###
  79.     ###
  80. #
  81. ####синхронизация времени
  82.     yum install cronie -y
  83.     yum install unzip -y
  84.     yum install nano -y
  85.  
  86.  
  87.     yum install ntpdate -y
  88.     \cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
  89.     ntpdate ru.pool.ntp.org
  90.     echo "0 0 * * * /sbin/ntpdate ru.pool.ntp.org" >> /var/spool/cron/root
  91.  
  92. #
  93. ####netcore
  94.     rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
  95.     yum update -y
  96.     yum install dotnet-sdk-3.0 -y
  97.  
  98. #
  99. #диск яндекс с настройкой бекапов каждые 00:00
  100.     #
  101.     #echo '
  102.     #[yandex]
  103.     #name=Yandex
  104.     #failovermethod=priority
  105.     #baseurl=http://repo.yandex.ru/yandex-disk/rpm/stable/'\$'basearch/
  106.     #enabled=1
  107.     #metadata_expire=1d
  108.     #gpgcheck=1
  109.     #gpgkey=http://repo.yandex.ru/yandex-disk/YANDEX-DISK-KEY.GPG' >> /etc/yum.repos.d/yandex.repo
  110.     #rpm --import http://repo.yandex.ru/yandex-disk/YANDEX-DISK-KEY.GPG
  111.     #yum install yandex-disk -y
  112.     #yandex-disk setup
  113.     #sleep 5
  114.     #yandex-disk start
  115.     #sleep 5
  116.     #yandex-disk stop
  117.     #mkdir /media/tempo
  118.     #
  119.     #echo '
  120.     ##!bin/bash
  121.     #rsync -avz  --exclude "dev" --exclude "lib64" --exclude "media" --exclude "opt" --exclude "root/Yandex.Disk" --exclude  #"boot" --exclude "lib" --exclude "lost+found" --exclude "mnt" --exclude "proc" --exclude "home" --exclude "run"  #--exclude "tmp" --exclude "srv" / /media/tempo
  122.     #zip -r /root/Yandex.Disk/backup.zip /media/tempo
  123.     #yandex-disk start
  124.     #sleep 5
  125.     #yandex-disk sync
  126.     #yandex-disk stop
  127.     #sleep 5
  128.     #rm -r -f -d /media/tempo/*
  129.     #rm -r -f -d /root/Yandex.Disk/*
  130.     #'>> /root/.config/yandex-disk/backup.sh
  131.     #echo "0 0 * * * /root/.config/yandex-disk/backup.sh" >> /var/spool/cron/root
  132.     #
  133.     #
  134. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement