X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debian%2Fopenvswitch-switch.init;h=92ab7756850803df5c64b8b74568bd5776098d94;hb=088a727c9ca2a9b54e11de94e1fc4396a277523a;hp=60cc369f54a376bb541cff089ac6645c72e65e86;hpb=78a04c9fc2b426231f3aedf8961491b238fc78bb;p=sliver-openvswitch.git diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 60cc369f5..92ab77568 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -226,12 +226,11 @@ case "$1" in if test ! -e $conf_file; then # Create configuration database. ovsdb-tool -vANY:console:emer create $conf_file $schema_file - else - # If schema version changed, then back up the old version. - old_ver=`ovsdb-tool db-version "$conf_file"` - if test "X$old_ver" != "X$schema_ver"; then - cp "$conf_file" "$conf_file.backup$old_ver" - fi + elif test "X`ovsdb-tool needs-conversion $conf_file $schema_file`" != Xno; then + # Back up the old version. + version=`ovsdb-tool db-version "$conf_file"` + cksum=`ovsdb-tool db-cksum "$conf_file" | awk '{print $1}'` + cp "$conf_file" "$conf_file.backup$version-$cksum" # Upgrade or downgrade schema and compact database. ovsdb-tool -vANY:console:emer convert $conf_file $schema_file @@ -262,7 +261,6 @@ case "$1" in set -- "$@" --log-file=/var/log/openvswitch/ovsdb-server.log set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" --remote punix:/var/run/openvswitch/db.sock - set -- "$@" --remote db:Open_vSwitch,managers set -- "$@" --remote db:Open_vSwitch,manager_options set -- "$@" --private-key=db:SSL,private_key set -- "$@" --certificate=db:SSL,certificate