move sepurator to variables and add that entrypoint.sh can run install script if you like to install more packages

This commit is contained in:
2022-07-03 11:47:40 +02:00
parent c6f70f5c67
commit f1e6452890
5 changed files with 37 additions and 23 deletions
+2 -4
View File
@@ -16,10 +16,6 @@ export PS1="\[\e[31m\][\[\e[m\]\[\e[38;5;172m\]\u\[\e[m\]@\[\e[38;5;153m\]\h\[\e
##############################################################################################################################
source "/variables.sh"
function sepurator {
echo "=============================================================================================="
}
function find_borg_repo {
repo_list=( $(find "$1" -name "index.*" -type f | rev | cut -d '/' -f "2-" | rev) )
@@ -67,6 +63,7 @@ function select_borg_repo {
}
function ask_for_repo_password {
if [ -z "$BORG_PASSPHRASE" ]; then
if grep -q 'key' "$BORG_REPO/config"; then
echo "* BORG REPO has a password"
sepurator
@@ -80,6 +77,7 @@ function ask_for_repo_password {
echo "* BORG REPO has no password"
fi
sepurator
fi
}
function print_container_info {
+1 -2
View File
@@ -1,3 +1,2 @@
sshkeys/clients/
sshkeys/host/
sshkeys/
backups/
+1
View File
@@ -5,6 +5,7 @@ ENV UID=1000
ENV GID=1000
ENV MAINTENANCE_ENABLE="false"
ENV INTERACTIVE_MODE="false"
ENV RUN_INSTALL_SCRIPT="false"
ENV TZ=""
# Add Folders and Shell Scripts
+15 -5
View File
@@ -3,10 +3,6 @@ source "/variables.sh"
##############################################################################################################################
# Funktionen
##############################################################################################################################
function sepurator {
echo "==============================================================================="
}
function print_container_info {
sepurator
echo "* BorgServer powered by $BORG_VERSION"
@@ -117,7 +113,7 @@ function maintenance_enable {
echo ""
if [ -f "/crontab.txt" ]; then
/usr/bin/crontab "/crontab.txt"
/usr/sbin/crond -b
/usr/sbin/crond -b 2> /dev/null
echo "- Crontab loaded successfully"
else
echo "- Can not find /crontab.txt"
@@ -135,6 +131,19 @@ function set_timezone {
fi
sepurator
}
function run_install_script {
if [ "$RUN_INSTALL_SCRIPT" != "false" ]; then
if [ ! -f "/.runnedInstall" ]; then
echo "* RUNNING INSTALL SCRIPT"
sepurator
sh "$RUN_INSTALL_SCRIPT"
echo ""
sepurator
touch "/.runnedInstall"
fi
fi
}
##############################################################################################################################
# Main Code
##############################################################################################################################
@@ -150,6 +159,7 @@ sepurator
maintenance_enable
set_timezone
run_install_script
echo "* Init done! - Starting SSH-Daemon..."
sepurator
+7 -1
View File
@@ -1,3 +1,9 @@
DOCKER_IMAGE_VERSION="1.0.9"
BORG_VERSION=$(borg -V)
SSH_FOLDERS=( /sshkeys/clients /sshkeys/host )
SSH_FOLDERS=( "/sshkeys/clients" "/sshkeys/host" )
##############################################################################################################################
# Funktionen
##############################################################################################################################
function sepurator {
echo "======================================================================================"
}