Browse Source

Change entrypoint.sh and healthcheck.sh

Admin User 4 years ago
parent
commit
1ddab8edfc
2 changed files with 12 additions and 12 deletions
  1. 11 11
      entrypoint.sh
  2. 1 1
      healthcheck.sh

+ 11 - 11
entrypoint.sh

@@ -24,12 +24,12 @@ function sec_init {
   quit;
   quit;
 EOF
 EOF
 
 
-  if [ -f /fb3-user-password/FB3_USER_NAME ] && [ -f /fb3-user-password/FB3_USER_PWD ]; then
-    echo "Setting up Firebird user $(cat /fb3-user-password/FB3_USER_NAME) with 'grant create database'"
+  if [ -f /secrets/FB3_USER_NAME ] && [ -f /secrets/FB3_USER_PWD ]; then
+    echo "Setting up Firebird user $(cat /secrets/FB3_USER_NAME) with 'grant create database'"
     cat <<EOF | isql-fb security.db
     cat <<EOF | isql-fb security.db
-    create or alter user $(cat /fb3-user-password/FB3_USER_NAME) password '$(cat /fb3-user-password/FB3_USER_PWD)' using plugin Srp;
-    create or alter user $(cat /fb3-user-password/FB3_USER_NAME) password '$(cat /fb3-user-password/FB3_USER_PWD)' using plugin Legacy_UserManager;
-    grant create database to user $(cat /fb3-user-password/FB3_USER_NAME);
+    create or alter user $(cat /secrets/FB3_USER_NAME) password '$(cat /secrets/FB3_USER_PWD)' using plugin Srp;
+    create or alter user $(cat /secrets/FB3_USER_NAME) password '$(cat /secrets/FB3_USER_PWD)' using plugin Legacy_UserManager;
+    grant create database to user $(cat /secrets/FB3_USER_NAME);
     commit;
     commit;
     quit;
     quit;
 EOF
 EOF
@@ -44,12 +44,12 @@ function checkbase_init {
 EOF
 EOF
 }
 }
 
 
-if [ ! -f /fb3-user-password/FB3_SYSDBA_PWD ]; then
-  mkdir -p /fb3-user-password
-  echo $RANDOM$RANDOM > /fb3-user-password/FB3_SYSDBA_PWD
-  echo "Setting SYSDBA's random password: "$( cat /fb3-user-password/FB3_SYSDBA_PWD )
+if [ ! -f /secrets/FB3_SYSDBA_PWD ]; then
+  mkdir -p /secrets
+  echo $RANDOM$RANDOM > /secrets/FB3_SYSDBA_PWD
+  echo "Setting SYSDBA's random password: "$( cat /secrets/FB3_SYSDBA_PWD )
 fi
 fi
-_SYSDBA_PWD=$(cat /fb3-user-password/FB3_SYSDBA_PWD)
+_SYSDBA_PWD=$(cat /secrets/FB3_SYSDBA_PWD)
 
 
 # Вынос security3.fdb на ПМЖ
 # Вынос security3.fdb на ПМЖ
 [[ ${EXT_SECURITY} && ${EXT_SECURITY}="true" ]] && \
 [[ ${EXT_SECURITY} && ${EXT_SECURITY}="true" ]] && \
@@ -57,7 +57,7 @@ _SYSDBA_PWD=$(cat /fb3-user-password/FB3_SYSDBA_PWD)
 
 
 # Создаем символические ссылки на конфигурационные файлы
 # Создаем символические ссылки на конфигурационные файлы
 for i in $(ls -d /configs/*.conf); do ln -sf ${i} /etc/firebird/;done
 for i in $(ls -d /configs/*.conf); do ln -sf ${i} /etc/firebird/;done
-ln -sf /cluster/cluster.conf /usr/lib64/firebird/plugins/
+[ -f /secrets/cluster.conf ] && ln -sf /secrets/cluster.conf /usr/lib64/firebird/plugins/
 
 
 sec_init
 sec_init
 checkbase_init
 checkbase_init

+ 1 - 1
healthcheck.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-isql-fb -user SYSDBA -password "$(cat /fb3-user-password/FB3_SYSDBA_PWD)" 127.0.0.1:$(cat /etc/firebird/check-database.conf) << "EOF" || exit 1
+isql-fb -user SYSDBA -password "$(cat /secrets/FB3_SYSDBA_PWD)" 127.0.0.1:$(cat /etc/firebird/check-database.conf) << "EOF" || exit 1
 SHOW DATABASE;
 SHOW DATABASE;
 EOF
 EOF