# SFA default config (read-only template)
sfa_default_config=/etc/sfa/default_config.xml
# SFA local (site-dependent) file
# SFA default config (read-only template)
sfa_default_config=/etc/sfa/default_config.xml
# SFA local (site-dependent) file
files=( $sfa_default_config $sfa_local_config )
for file in "${files[@]}" ; do
if [ -n "$force" -o $file -nt $sfa_whole_config ] ; then
files=( $sfa_default_config $sfa_local_config )
for file in "${files[@]}" ; do
if [ -n "$force" -o $file -nt $sfa_whole_config ] ; then
# Convert configuration to various formats
if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config ] ; then
# Convert configuration to various formats
if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config ] ; then
- if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config.py ] ; then
- plc-config --python $sfa_whole_config > /etc/sfa/sfa_config.py
+ if [ -n "$force" -o $sfa_whole_config -nt /etc/sfa/sfa_config.sh ] ; then
+ sfa-config --shell $sfa_whole_config > /etc/sfa/sfa_config.sh
######## compute a password if needed
if [ -z "$SFA_DB_PASSWORD" ] ; then
SFA_DB_PASSWORD=$(uuidgen)
######## compute a password if needed
if [ -z "$SFA_DB_PASSWORD" ] ; then
SFA_DB_PASSWORD=$(uuidgen)
PLC_DB_USER=$(plc-config --category=plc_db --variable=user)
PLC_DB_PASSWORD=$(plc-config --category=plc_db --variable=password)
# store this as the SFA user/password
PLC_DB_USER=$(plc-config --category=plc_db --variable=user)
PLC_DB_PASSWORD=$(plc-config --category=plc_db --variable=password)
# store this as the SFA user/password
- plc-config --category=sfa_db --variable=user --value=$PLC_DB_USER --save=$sfa_local_config $sfa_local_config >& /dev/null
- plc-config --category=sfa_db --variable=password --value=$PLC_DB_PASSWORD --save=$sfa_local_config $sfa_local_config >& /dev/null
+ sfa-config --category=sfa_db --variable=user --value=$PLC_DB_USER --save=$sfa_local_config $sfa_local_config >& /dev/null
+ sfa-config --category=sfa_db --variable=password --value=$PLC_DB_PASSWORD --save=$sfa_local_config $sfa_local_config >& /dev/null