interface $interface
 no shut
exit

ip sla auto discovery
access-list 197 permit icmp any $slaIP 0.0.0.0

ip local policy route-map track-primary-if

route-map track-primary-if permit 1
 match ip address 197
 set interface $primaryInterface
 exit

ip route 0.0.0.0 0.0.0.0 $primaryInterface 1 track 1

ip sla 1
 icmp-echo $slaIP source-interface $primaryInterface
 timeout 5000
 frequency 60
 threshold 5000
 exit

track 1 ip sla 1 reachability

ip sla schedule 1 life forever start-time now

ip route 0.0.0.0 0.0.0.0 $interface 253

no ip route 0.0.0.0 0.0.0.0 $primaryRouteInterface

