3 # Low Level CAN Framework
4 # Copyright (c) 2005 Volkswagen Group Electronic Research
8 # Simple script to start CAN and VCAN interfaces
10 # Exit if ifconfig is not installed
11 test -x /sbin/ifconfig || exit 0
13 # On some systems the automatic module loading via
14 # /etc/modules.conf is quite slow. To ensure the immediately
15 # availability of specific modules you can define critical
16 # modules in the PROBE variable. E.g. PROBE="can-tp20"
18 # Exit if modprobe is not installed
19 test -x /sbin/modprobe || exit 0
27 if [ -n "$CAN_IF" ] ; then
28 echo -n "Enabling CAN interfaces:"
35 if [ -n "$VCAN_IF" ] ; then
36 echo -n "Enabling virtual CAN interfaces:"
37 for IF in $VCAN_IF; do
43 if [ -n "$PROBE" ] ; then
44 echo -n "Extra probing LLCF modules:"
45 for MODULE in $PROBE; do
46 /sbin/modprobe $MODULE
53 if [ -n "$CAN_IF" ] ; then
54 echo -n "Restarting CAN interfaces:"
56 /sbin/ifconfig $IF down
62 if [ -n "$VCAN_IF" ] ; then
63 echo -n "Restarting virtual CAN interfaces:"
64 for IF in $VCAN_IF; do
65 /sbin/ifconfig $IF down
73 if [ -n "$CAN_IF" ] ; then
74 echo -n "Shutting down CAN interfaces:"
76 /sbin/ifconfig $IF down
81 if [ -n "$VCAN_IF" ] ; then
82 echo -n "Shutting down virtual CAN interfaces:"
83 for IF in $VCAN_IF; do
84 /sbin/ifconfig $IF down
91 echo "Usage: /etc/init.d/can_if {start|stop|restart|reload|force-reload}"