mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-17 20:11:17 +00:00
Update jellyfin_setup.sh
This commit is contained in:
parent
1b9a9e4de0
commit
3973532510
@ -7,7 +7,11 @@ set -o pipefail
|
|||||||
shopt -s expand_aliases
|
shopt -s expand_aliases
|
||||||
alias die='EXIT=$? LINE=$LINENO error_exit'
|
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||||
trap die ERR
|
trap die ERR
|
||||||
|
CROSS='\033[1;31m\xE2\x9D\x8C\033[0m'
|
||||||
CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
|
CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m'
|
||||||
|
RETRY_NUM=5
|
||||||
|
RETRY_EVERY=3
|
||||||
|
NUM=$RETRY_NUM
|
||||||
trap 'die "Script interrupted."' INT
|
trap 'die "Script interrupted."' INT
|
||||||
|
|
||||||
function error_exit() {
|
function error_exit() {
|
||||||
@ -26,6 +30,17 @@ function msg() {
|
|||||||
echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m"
|
echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m"
|
||||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||||
locale-gen >/dev/null
|
locale-gen >/dev/null
|
||||||
|
while [ "$(hostname -I)" = "" ]; do
|
||||||
|
1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)"
|
||||||
|
sleep $RETRY_EVERY
|
||||||
|
((NUM--))
|
||||||
|
if [ $NUM -eq 0 ]
|
||||||
|
then
|
||||||
|
1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)"
|
||||||
|
|
||||||
echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m"
|
echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m"
|
||||||
apt update &>/dev/null
|
apt update &>/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user