add configure_miniconda
This commit is contained in:
parent
82222fd071
commit
a58984204a
25
init_root.sh
25
init_root.sh
@ -3,6 +3,11 @@
|
|||||||
scriptdir=$(dirname $(realpath $0))
|
scriptdir=$(dirname $(realpath $0))
|
||||||
tempdir="/tmp"
|
tempdir="/tmp"
|
||||||
|
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
echo "This script must be run as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
git_clone() {
|
git_clone() {
|
||||||
@ -188,7 +193,7 @@ configure_timedate() {
|
|||||||
configure_fail2ban() {
|
configure_fail2ban() {
|
||||||
[ -f /etc/fail2ban/jail.local ] && return
|
[ -f /etc/fail2ban/jail.local ] && return
|
||||||
|
|
||||||
read -p "要配置 fail2ban 吗?[Y]: " response
|
read -p "要配置 fail2ban 吗?[N]: " response
|
||||||
|
|
||||||
if [[ $response =~ ^[Yy]$ ]]; then
|
if [[ $response =~ ^[Yy]$ ]]; then
|
||||||
apt install fail2ban
|
apt install fail2ban
|
||||||
@ -200,10 +205,17 @@ configure_fail2ban() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
configure_miniconda() {
|
||||||
echo "This script must be run as root."
|
[ -d ~/.miniconda3 ] && return
|
||||||
exit 1
|
|
||||||
fi
|
read -p "要安装 miniconda 吗?[N]: " response
|
||||||
|
|
||||||
|
if [[ $response =~ ^[Yy]$ ]]; then
|
||||||
|
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $tempdir/miniconda.sh
|
||||||
|
bash $tempdir/miniconda.sh -b -p ~/.miniconda3
|
||||||
|
rm $tempdir/miniconda.sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_google_access
|
check_google_access
|
||||||
configure_ssh
|
configure_ssh
|
||||||
@ -216,6 +228,7 @@ configure_apt_install
|
|||||||
configure_zsh
|
configure_zsh
|
||||||
configure_tmux
|
configure_tmux
|
||||||
configure_iptables
|
configure_iptables
|
||||||
# configure_hostname
|
configure_hostname
|
||||||
configure_timedate
|
configure_timedate
|
||||||
configure_fail2ban
|
configure_fail2ban
|
||||||
|
configure_miniconda
|
||||||
|
|||||||
30
init_sudo.sh
30
init_sudo.sh
@ -3,6 +3,16 @@
|
|||||||
scriptdir=$(dirname $(realpath $0))
|
scriptdir=$(dirname $(realpath $0))
|
||||||
tempdir="/tmp"
|
tempdir="/tmp"
|
||||||
|
|
||||||
|
if [[ $EUID -eq 0 ]]; then
|
||||||
|
echo "This script should not be run as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! sudo -v; then
|
||||||
|
echo "Please get sudo access first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
git_clone() {
|
git_clone() {
|
||||||
@ -189,7 +199,7 @@ configure_timedate() {
|
|||||||
configure_fail2ban() {
|
configure_fail2ban() {
|
||||||
[ -f /etc/fail2ban/jail.local ] && return
|
[ -f /etc/fail2ban/jail.local ] && return
|
||||||
|
|
||||||
read -p "要配置 fail2ban 吗?[Y]: " response
|
read -p "要配置 fail2ban 吗?[N]: " response
|
||||||
|
|
||||||
if [[ $response =~ ^[Yy]$ ]]; then
|
if [[ $response =~ ^[Yy]$ ]]; then
|
||||||
sudo apt install fail2ban
|
sudo apt install fail2ban
|
||||||
@ -201,10 +211,17 @@ configure_fail2ban() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $EUID -eq 0 ]]; then
|
configure_miniconda() {
|
||||||
echo "This script should not be run as root."
|
[ -d ~/.miniconda3 ] && return
|
||||||
exit 1
|
|
||||||
fi
|
read -p "要安装 miniconda 吗?[N]: " response
|
||||||
|
|
||||||
|
if [[ $response =~ ^[Yy]$ ]]; then
|
||||||
|
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $tempdir/miniconda.sh
|
||||||
|
bash $tempdir/miniconda.sh -b -p ~/.miniconda3
|
||||||
|
rm $tempdir/miniconda.sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_google_access
|
check_google_access
|
||||||
configure_ssh
|
configure_ssh
|
||||||
@ -217,6 +234,7 @@ configure_apt_install
|
|||||||
configure_zsh
|
configure_zsh
|
||||||
configure_tmux
|
configure_tmux
|
||||||
configure_iptables
|
configure_iptables
|
||||||
# configure_hostname
|
configure_hostname
|
||||||
configure_timedate
|
configure_timedate
|
||||||
configure_fail2ban
|
configure_fail2ban
|
||||||
|
configure_miniconda
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user