From b5cde5312713c4e8233cafefb556475ff3a98c44 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 May 2025 10:07:31 +0000 Subject: [PATCH] Updated installer --- config/aliases.sh | 1 + filebrowser/docker-compose.yaml | 1 + install.sh | 25 +++++++++++++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 config/aliases.sh diff --git a/config/aliases.sh b/config/aliases.sh new file mode 100644 index 0000000..8dc35c5 --- /dev/null +++ b/config/aliases.sh @@ -0,0 +1 @@ +alias smbtools="bash $SMB_TOOLS_PATH/gui/main.sh" \ No newline at end of file diff --git a/filebrowser/docker-compose.yaml b/filebrowser/docker-compose.yaml index 35e34ed..5362aec 100644 --- a/filebrowser/docker-compose.yaml +++ b/filebrowser/docker-compose.yaml @@ -3,6 +3,7 @@ services: filebrowser: image: filebrowser/filebrowser:latest container_name: filebrowser + restart: always entrypoint: ./start.sh volumes: - /data:/srv #Change to match your directory diff --git a/install.sh b/install.sh index 6eb0985..b05e8b2 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Define colors +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + + echo -e "${GREEN}------------------------${NC}" echo -e "${GREEN} SmbTools installer ${NC}" echo -e "${GREEN}------------------------${NC}" @@ -28,12 +34,23 @@ else echo "Added SMB_TOOLS_PATH to ~/.bashrc" fi -source $HOME/.bashrc +ALIASES_LINE="source $SMB_TOOLS_PATH/config/aliases.sh" -# Set it for the current script execution too -export SMB_TOOLS_PATH="$SCRIPT_DIR" -echo "SMB_TOOLS_PATH set to: $SMB_TOOLS_PATH" +# Check if it's already set in .bashrc +if grep -Fxq "$ALIASES_LINE" "$HOME/.bashrc"; then + echo "SmbTools aliases already set" +else + echo "$ALIASES_LINE" >> "$HOME/.bashrc" + echo "Set SmbTools aliases" +fi + +source $HOME/.bashrc cd filebrowser bash ./install.sh cd .. + +echo -e "${YELLOW}------------------------------------------------------${NC}" +echo -e "${YELLOW} !!! WARNING !!! ${NC}" +echo -e "${YELLOW} The computer must be restarted to complete the setup ${NC}" +echo -e "${YELLOW}------------------------------------------------------${NC}" \ No newline at end of file