This allows ODBC drivers to create odbcinst.ini-snippets in /etc/odbcinst.ini.d/ which will be assembled into /tmp/etc/odbcinst.ini. /etc/odbcinst.ini is provided as a symlink pointing to /tmp/etc/odbcinst.ini Hence the unixODBC-provided PostgreSQL driver was also given an odbcinst.ini.d snippet. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
26 lines
455 B
Bash
26 lines
455 B
Bash
#!/bin/sh /etc/rc.common
|
|
|
|
START=50
|
|
|
|
gen_odbcinst() {
|
|
local inifile
|
|
|
|
echo "[ODBC]"
|
|
echo "Trace = off"
|
|
echo "TraceFile ="
|
|
|
|
for inifile in /etc/odbcinst.ini.d/*.ini; do
|
|
cat "$inifile"
|
|
done
|
|
}
|
|
|
|
start() {
|
|
[ ! -d /tmp/etc ] && mkdir /tmp/etc
|
|
|
|
gen_odbcinst > /tmp/etc/odbcinst.ini.new
|
|
chmod 0644 /tmp/etc/odbcinst.ini.new
|
|
|
|
[ -e /tmp/etc/odbcinst.ini ] && ( rm /tmp/etc/odbcinst.ini || return 1 )
|
|
|
|
mv /tmp/etc/odbcinst.ini.new /tmp/etc/odbcinst.ini
|
|
}
|