Updated installer

This commit is contained in:
root 2025-05-25 10:07:31 +00:00
parent 58f0fe6adc
commit b5cde53127
3 changed files with 23 additions and 4 deletions

1
config/aliases.sh Normal file
View File

@ -0,0 +1 @@
alias smbtools="bash $SMB_TOOLS_PATH/gui/main.sh"

View File

@ -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

View File

@ -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}"