function assign_raw()
{
- cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do
- if [ -n "$RAW" -a -n "$BLOCK" ]; then
+ cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do
+ if [ -n "$RAW" -a -n "$BLOCK" ]; then
if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then
nls " Please correct your /etc/sysconfig/rawdevices:"
nls " rawdevices are now located in the directory /dev/raw/ "
exit 0
fi
- show $(nls "Assigning device: %s --> %s" "$RAW" "$BLOCK")
+ show "$(nls "Assigning device: %s --> %s" "$RAW" "$BLOCK")"
busy
raw $RAW $BLOCK > /dev/null
ok
done
}
-
-# See how we were called.
-case "$1" in
- start)
+start() {
if [ ! -f /var/lock/subsys/rawdevices ]; then
msg_starting rawdevices
ok
touch /var/lock/subsys/rawdevices
else
msg_already_running rawdevices
- exit 1
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/rawdevices ]; then
msg_stopping rawdevices
busy
ok
else
msg_not_running rawdevices
- exit 1
fi
+}
+
+# See how we were called.
+case "$1" in
+ start|reload)
+ start
+ ;;
+ stop)
+ stop
;;
status)
- ID=`id -u`
- if [ $ID -eq 0 ]; then
+ id=`id -u`
+ if [ "$id" -eq 0 ]; then
raw -qa
else
# don't remove the space at the end!!!
nls "You need to be root to use this command ! "
fi
;;
- restart|reload)
- $0 stop
- $0 start
+ restart|force-reload)
+ stop
+ start
;;
*)
- msg_usage "$0 {start|stop|restart|reload|status}"
- exit 1
+ msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+ exit 3
esac
exit 0