Skip to content

Commit

Permalink
Fix automation script path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Dec 8, 2024
1 parent c2bbd62 commit 32fce0a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
13 changes: 13 additions & 0 deletions script/bin/auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ export CYAN='\033[36m'
export RESET='\033[0m'


ENV_FILE="/etc/profile.d/dinky_env"
if [ -f "${ENV_FILE}" ]; then
source "${ENV_FILE}"
fi

DB_ENV_FILE="/etc/profile.d/dinky_db"
if [ -f "${DB_ENV_FILE}" ]; then
source "${DB_ENV_FILE}"
fi

source /etc/profile



if [ -z "${DINKY_HOME}" ]; then
echo -e "${RED}DINKY_HOME environment variable is not set. Attempting to determine the correct path...${RESET}"
Expand Down
35 changes: 29 additions & 6 deletions script/bin/init_tools_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,32 @@ while true; do
esac
done
echo -e "${GREEN} ====================== Database configuration file initialization script -> End ====================== ${RESET}"
echo
echo
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo

while true; do
read -p "Do you need to start the Dinky service?(yes/no/exit)" is_start
is_start=$(echo "$is_start" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')
case $is_start in
yes | y )
# Use source transparent transmission in debug mode
source "${APP_HOME}/bin/auto.sh restart"
break
;;
no | n )
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo -e "${RED}Note: To make these changes permanent, you may need to restart your terminal or run 'source $DB_ENV_FILE && source $ENV_FILE' ${RESET}"
echo
echo -e "${GREEN}The Dinky service startup script has been skipped, 请先执行上述命令,然后手动启动服务 -> ${APP_HOME}/bin/auto.sh restart | start。${RESET}"
break
;;
exit | e )
echo -e "${GREEN}If you choose exit, the program will exit。${RESET}"
exit 0
;;
*)
echo -e "${RED}Invalid input, please re-enter yes/no/exit。${RESET}"
;;
esac
done

echo -e "${GREEN} ====================== Dinky initialization script execution completed ====================== ${RESET}"

0 comments on commit 32fce0a

Please sign in to comment.