Update debian-v5-install.sh

This commit is contained in:
tteckster 2023-03-20 21:24:34 -04:00 committed by GitHub
parent d5f52e7e21
commit 8d3610035a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 40 deletions

View File

@ -1,51 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#source $(dirname $FUNCTIONS_FILE_PATH)
#source "$FUNCTIONS_FILE_PATH"
#source "$FUNCTIONS_FILE_PATH" > /dev/null
#function_script=$(mktemp)
#wget -qO "$function_script" https://raw.githubusercontent.com/tteck/Proxmox/dev/misc/function.sh
#source "$function_script"
#source <(wget -qO- https://raw.githubusercontent.com/tteck/Proxmox/dev/misc/function.sh)
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
#source /dev/stdin <<< wget -qO- https://raw.githubusercontent.com/tteck/Proxmox/dev/misc/function.sh
#source /dev/stdin <<< "$(wget -qO- https://raw.githubusercontent.com/tteck/Proxmox/dev/misc/function.sh)"
#wget -qO /tmp/function.sh https://raw.githubusercontent.com/tteck/Proxmox/dev/misc/function.sh
#chmod +x /tmp/function.sh
#source /tmp/function.sh
# Copyright (c) 2021-2023 tteck # Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster) # Author: tteck (tteckster)
# License: MIT # License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE # https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi if [ "$VERBOSE" = "yes" ]; then set -x; STD=""; else STD="silent"; fi
silent() { "$@" > /dev/null 2>&1; } silent() { "$@" > /dev/null 2>&1; }
if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi if [ "$DISABLEIPV6" == "yes" ]; then echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf; $STD sysctl -p; fi
YW=$(echo "\033[33m") color
RD=$(echo "\033[01;31m")
BL=$(echo "\033[36m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
RETRY_NUM=10
RETRY_EVERY=3
CM="${GN}${CL}"
CROSS="${RD}${CL}"
BFR="\\r\\033[K"
HOLD="-"
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
msg_info "Setting up Container OS"
setting_up_container setting_up_container
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
network_ckeck network_ckeck
update_os
msg_info "Updating Container OS"
$STD apt-get update
$STD apt-get -y upgrade
msg_ok "Updated Container OS"
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y curl $STD apt-get install -y curl
@ -53,16 +22,12 @@ $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
echo "export TERM='xterm-256color'" >>/root/.bashrc motd
echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
chmod -x /etc/update-motd.d/*
if ! getent shadow root | grep -q "^root:[^\!*]"; then if ! getent shadow root | grep -q "^root:[^\!*]"; then
customize customize
fi fi
if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
msg_info "Cleaning up" msg_info "Cleaning up"
rm "$function_script"
$STD apt-get autoremove $STD apt-get autoremove
$STD apt-get autoclean $STD apt-get autoclean
msg_ok "Cleaned" msg_ok "Cleaned