buildrootschalter/package/targetcli-fb/S50target
Christophe Vu-Brugier 3867623c23 targetcli-fb: new package
targetcli-fb is a command-line interface for configuring the LIO
generic SCSI target, present in 3.x Linux kernel versions.

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-09-21 19:45:54 +02:00

47 lines
551 B
Bash
Executable File

#!/bin/sh
#
# Restore / clear the Linux "SCSI target" driver configuration with `targetctl`
#
start() {
local ret
echo -n "Restoring target configuration: "
/usr/bin/targetctl restore >/dev/null 2>&1
ret=$?
echo "done"
return $ret
}
stop() {
local ret
echo -n "Clearing target configuration: "
/usr/bin/targetctl clear >/dev/null 2>&1
ret=$?
echo "done"
return $ret
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac