-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit-sqlite.sh
More file actions
executable file
·36 lines (24 loc) · 860 Bytes
/
init-sqlite.sh
File metadata and controls
executable file
·36 lines (24 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Initialize an SQLite DB for the server info collection
#
# SQLite DB file
DB="./server-info.db"
SQLCMD="BEGIN TRANSACTION;
create table domain (server, date, name, domain);
create table platform (server, date, manf, product, fwver, serial, warrexp);
create table cpus (server, date, manf, fam, freq, num, numfree);
create table mem (server, date, totmb, nummods, modsize, max);
create table os (server, date, brand, product, ver, arch, yumrepos);
create table ifaces (server, date, dnsname, pubip, privip, iface, mac);
create table cnames (server, date, cname, dnsname);
create table mountpts (server, date, mountpt, device, size, fstype);
COMMIT; "
if [ -a $DB ]
then
echo "Database already exists! -- $DB "
else
#echo "$SQLCMD"
echo "Creating Server Info Database file: $DB "
echo "$SQLCMD" | sqlite $DB
fi