From 744597ef012ff72373defc746a2438ec8dd3de4a Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 24 Oct 2015 03:44:27 +0200 Subject: bin/rts: Making the sourcing of files more failsafe. --- bin/rts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/rts b/bin/rts index 509590b..fcb6c15 100755 --- a/bin/rts +++ b/bin/rts @@ -1,8 +1,16 @@ #!/usr/bin/env bash -#Applies real-time kernel specific settings found in /etc/rts.d/* +#Applies real-time kernel specific settings found in /etc/rts/* if [ "$1" ]; then - . /etc/rts/"$1" + if [ -f /etc/rts/"$1" ]; then + . /etc/rts/"$1" + else + exit 1 + fi else - . /etc/rts/rts + if [ -f /etc/rts/rts ]; then + . /etc/rts/rts + else + exit 1 + fi fi -- cgit v1.2.3-54-g00ecf