2 |
# $Id$ |
# $Id$ |
3 |
|
|
4 |
RC_INIT_BASE=${MROOT}/etc/init.d |
RC_INIT_BASE=${MROOT}/etc/init.d |
5 |
RC_EXCLUDE="rc functions template splash-functions udev mdev" |
RC_EXCLUDE="rc functions template splash-functions udev mdev README" |
6 |
|
|
7 |
VERSION=0.4 |
VERSION=0.5 |
8 |
|
|
9 |
get_run_levels() |
get_run_levels() |
10 |
{ |
{ |
220 |
fi |
fi |
221 |
} |
} |
222 |
|
|
223 |
|
rc_service_control() |
224 |
|
{ |
225 |
|
local cmd="$1" |
226 |
|
local svc="$2" |
227 |
|
|
228 |
|
case ${cmd} in |
229 |
|
start|stop|restart|reload|status) ;; |
230 |
|
*) echo "unknown operation"; exit 1 ;; |
231 |
|
esac |
232 |
|
|
233 |
|
if [ ! -e ${RC_INIT_BASE}/${svc} ] |
234 |
|
then |
235 |
|
echo "Service '${RC_INIT_BASE}/${svc}' does not exist." |
236 |
|
exit 1 |
237 |
|
fi |
238 |
|
|
239 |
|
if [[ -n ${MROOT} ]] |
240 |
|
then |
241 |
|
echo "\${MROOT} is set, not starting service $2" |
242 |
|
else |
243 |
|
if [ -x ${RC_INIT_BASE}/${svc} ] |
244 |
|
then |
245 |
|
${RC_INIT_BASE}/${svc} ${cmd} |
246 |
|
else |
247 |
|
echo "Service '${RC_INIT_BASE}/${svc}' is not executable." |
248 |
|
exit 1 |
249 |
|
fi |
250 |
|
fi |
251 |
|
} |
252 |
|
|
253 |
|
|
254 |
usage() |
usage() |
255 |
{ |
{ |
256 |
echo "Magellan RC Configurator v${VERSION} -- Niels Rogalla (niro@magellan-linux.de)" |
echo "Magellan RC Configurator v${VERSION} -- Niels Rogalla (niro@magellan-linux.de)" |
259 |
echo -e " del deletes script from runlevel" |
echo -e " del deletes script from runlevel" |
260 |
echo -e " show shows current runlevel settings" |
echo -e " show shows current runlevel settings" |
261 |
echo -e " default x changes default runlevel to x" |
echo -e " default x changes default runlevel to x" |
262 |
|
echo -e " start starts given runlevel script" |
263 |
|
echo -e " stop stops given runlevel script" |
264 |
|
echo -e " reload reloads given runlevel script" |
265 |
|
echo -e " restart restarts given runlevel script" |
266 |
|
echo -e " status prints status of given service" |
267 |
echo -e "\n" |
echo -e "\n" |
268 |
} |
} |
269 |
|
|
292 |
rc_service_show $2 |
rc_service_show $2 |
293 |
fi |
fi |
294 |
;; |
;; |
295 |
|
start|stop|reload|restart|status) |
296 |
|
rc_service_control $1 $2 |
297 |
|
;; |
298 |
default) |
default) |
299 |
chg_initdefault $2 |
chg_initdefault $2 |
300 |
;; |
;; |