]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding admin user preset value
authorJean-Marc Pigeon <jmp@safe.c>
Fri, 14 Nov 2025 11:11:37 +0000 (06:11 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Fri, 14 Nov 2025 11:11:37 +0000 (06:11 -0500)
sql/preset.sql
support/do_database.sh
support/starting.sh

index 4a95c2222a2f02df90b78c8f065e4f6de9f1a82b..0e8cb6786e08e0497f34dad15145cc4161c6997f 100644 (file)
 /*     Creating the bare minimun user configuration    */
 /*                                                     */
 /********************************************************/
+//root is the default preset admin
 INSERT INTO admins (email)
        VALUES ('root@$DOMAINNAME');
+
+//inserting the mail account
+INSERT INTO emails (email,password)
+       VALUES ('root','$RPASS');
+
+
index 9d0daa16c7e9b7be886f68513ad892bc42f633f5..30cb9b0985504046c90e2283c69f9d4b4387bd82 100755 (executable)
@@ -98,6 +98,9 @@ case "$DB_TYPE" in
   esac
 #loading database definition
 if [ -n "$MSQL" ] ; then
+  echo "#--------------- Create Database ----------------" >> $SQLLOG
   cpp -P -D$DB_TYPE /usr/share/$APPNAME/sql/$APPNAME.sql| tee -a $SQLLOG | $MSQL
+  echo "#--------------- Set Preset value ---------------" >> $SQLLOG
   cpp -P -D$DB_TYPE /usr/share/$APPNAME/sql/preset.sql | tee -a $SQLLOG | $MSQL
+  echo "#--------------- Init Process Completed ---------" >> $SQLLOG
   fi
index 2765045114f14ab219ba176a35f2de6b25d7bcc5..534e860c05d9adcb93939f2c13f3092837f15b78 100755 (executable)
@@ -183,6 +183,9 @@ case "$DB_TYPE" in
     exit -3;
     ;;
   esac
+#extracting local configuration value
+export DOMAINNAME=`dnsdomainname`;
+export RPASS=`grep root /etc/shadow | cut -d':' -f2 |sed -e 's:\\\\$:\\\\\\\\$:g'`;
 }
 #----------------------------------------------------------------------
 #creating mailleur local certificat