#!/bin/bash # # setsched: facilitate changing the active scheduler plugin. ADIR=/proc/litmus/active_plugin PDIR=/proc/litmus/plugins CHOICE=$1 if [ ! -e $ADIR ]; then KERN=`uname -s -r` echo "Error: LITMUS^RT not found on $KERN!" exit 1 fi ACTIVE=`cat $ADIR` if [ -z "$1" ]; then TMP=`mktemp` (awk "{print \$1 \" 'Plugin'\"}" $PDIR | \ xargs dialog --title "Select Plugin" --backtitle "Current: $ACTIVE" \ --cancel-label "Cancel" --ok-label "Select Plugin" \ --menu "Select a new plugin to run: " 23 60 16) 2> $TMP OK=$? clear if [ "$OK" != "0" ]; then exit 0; fi CHOICE=`cat $TMP` rm $TMP fi echo "$CHOICE" > $ADIR ACTIVE=`cat $ADIR` if [ "$ACTIVE" != "$CHOICE" ]; then echo "Error: Setting new plugin failed." exit 1 fi