gregjoeval / KnightcardSignInDevice

A device to store information from Knightcards to replace the physical sign-in clipboard.
2 stars 1 forks source link

Initialization on a device #21

Open gregjoeval opened 7 years ago

gregjoeval commented 7 years ago

Might be smart to add the ability to set up a database for the first time use on a given device.

gregjoeval commented 7 years ago

We could create a function that runs once at the start of the script to check if the database has been created, if not then it could run the "sudo apt-get install mysql-server python-mysqldb" line in the terminal. The script could also then enter the appropriate MySQL commands to create the Knightcard sign-in database.

gregjoeval commented 7 years ago

This would probably a good resource: http://raspberrywebserver.com/sql-databases/using-mysql-on-a-raspberry-pi.html

aleccaputo commented 7 years ago

Only problem I see is the script would also have to create a user with the correct permissions as well. Other than that, sounds good.