only create admin account the first time

when importing an external traccar with on admin, this ends up
creating an admin
This commit is contained in:
Girish Ramakrishnan
2024-03-25 22:24:17 +01:00
parent 0bc71eaa5b
commit dd97a49741

View File

@@ -28,7 +28,7 @@ ensure_admin_account() {
wait_for_table tc_users;
echo "==> Ensure admin account"
count=`$mysql --skip-column-names -s -e "SELECT COUNT(*) FROM tc_users WHERE name='admin';"`
count=`$mysql --skip-column-names -s -e "SELECT COUNT(*) FROM tc_users;"`
if [[ "$count" = "0" ]]; then
echo "==> Create initial admin account"
# Values are from https://github.com/traccar/traccar/blob/master/schema/changelog-3.3.xml#L179 which is not used anymore, but we still want the admin account