use function to set all environment variables at once
This commit is contained in:
@@ -3,6 +3,19 @@ source "/variables.sh"
|
|||||||
#####################################################################################################
|
#####################################################################################################
|
||||||
# Funktionen
|
# Funktionen
|
||||||
#####################################################################################################
|
#####################################################################################################
|
||||||
|
function set_environment_variables_if_not_empty {
|
||||||
|
# Set Tmux Shell for .bashrc to load tmux and attach session if exists else create new session
|
||||||
|
if [ "$USE_TMUX_SHELL" != "" ]; then
|
||||||
|
echo "USE_TMUX_SHELL=$USE_TMUX_SHELL" >> /etc/environment
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set Server Timezone
|
||||||
|
if [ "$TZ" != "" ]; then
|
||||||
|
echo "TZ=$TZ" >> /etc/environment
|
||||||
|
ln -sf "/usr/share/zoneinfo/$TZ" /etc/localtime
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function print_container_info {
|
function print_container_info {
|
||||||
sepurator
|
sepurator
|
||||||
echo "* BorgServer powered by $BORG_VERSION"
|
echo "* BorgServer powered by $BORG_VERSION"
|
||||||
@@ -112,11 +125,9 @@ function maintenance_enable {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_timezone {
|
function show_timezone_output {
|
||||||
if [ "$TZ" != "" ]; then
|
if [ "$TZ" != "" ]; then
|
||||||
echo "* Setting Timezone to $TZ"
|
echo "* Setting Timezone to $TZ"
|
||||||
echo "TZ=$TZ" > /etc/environment
|
|
||||||
ln -sf "/usr/share/zoneinfo/$TZ" /etc/localtime
|
|
||||||
else
|
else
|
||||||
echo "* Timezone not set - Use UTC Time"
|
echo "* Timezone not set - Use UTC Time"
|
||||||
fi
|
fi
|
||||||
@@ -178,6 +189,7 @@ function run_prometheus_exporter() {
|
|||||||
#####################################################################################################
|
#####################################################################################################
|
||||||
# Main Code
|
# Main Code
|
||||||
#####################################################################################################
|
#####################################################################################################
|
||||||
|
set_environment_variables_if_not_empty
|
||||||
add_borg_user
|
add_borg_user
|
||||||
|
|
||||||
print_container_info
|
print_container_info
|
||||||
@@ -189,7 +201,7 @@ generate_host_sshkey
|
|||||||
sepurator
|
sepurator
|
||||||
|
|
||||||
maintenance_enable
|
maintenance_enable
|
||||||
set_timezone
|
show_timezone_output
|
||||||
run_teleport_server
|
run_teleport_server
|
||||||
run_prometheus_exporter
|
run_prometheus_exporter
|
||||||
run_install_script
|
run_install_script
|
||||||
|
|||||||
Reference in New Issue
Block a user