Update function.sh

This commit is contained in:
tteckster 2023-03-20 21:31:42 -04:00 committed by GitHub
parent 76fb7ceffb
commit 1410656586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 15 deletions

View File

@ -1,3 +1,16 @@
color() {
YW=$(echo "\033[33m")
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="-"
}
error_handler() {
local exit_code="$?"
@ -58,6 +71,7 @@ install_script() {
}
setting_up_container() {
msg_info "Setting up Container OS"
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
locale-gen >/dev/null
echo $tz > /etc/timezone
@ -74,6 +88,8 @@ setting_up_container() {
echo -e " 🖧 Check Network Settings"
exit 1
fi
msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(hostname -I)"
}
network_ckeck() {
@ -94,6 +110,18 @@ network_ckeck() {
set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
}
update_os() {
msg_info "Updating Container OS"
$STD apt-get update
$STD apt-get -y upgrade
msg_ok "Updated Container OS"
}
motd() {
echo "export TERM='xterm-256color'" >>/root/.bashrc
echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" > /etc/motd
chmod -x /etc/update-motd.d/*
if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config; systemctl restart sshd; fi
}
customize() {
msg_info "Customizing Container"