From 5feae401e3b03cefa1193b2b73fe919990aca016 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 01 Jun 2018 22:27:29 -0400 Subject: bin/rc: Fix svc script dir and session type validation --- diff --git a/bin/rc b/bin/rc index e96245c..4ce2fdb 100755 --- a/bin/rc +++ b/bin/rc @@ -34,7 +34,7 @@ valid_session_type() local session_type="${1}" shift 1 - case "${session_type}" in *[!A-Za-z0-9:]* | '' | ':'* | *':') + case "${session_type}" in *[!A-Za-z0-9:]* | '' | ':'* | *':' | ':') return 1 esac return 0 @@ -49,7 +49,7 @@ run_services() local service_script= ret=0 - for service_script in "${XDG_CACHE_HOME:-${HOME}/.cache}/homerc/"*; do + for service_script in "${XDG_CONFIG_HOME:-${HOME}/.config}/homerc/"*; do "$(dirname "${0}")/svc" "${service_script##*/}" \ "${old_sessions};${new_sessions}" || ret=1 done @@ -284,7 +284,7 @@ main() case "${action}" in 'start' | 'stop') - if [ ${#} -ne 2 ] || valid_session_type \ + if [ ${#} -ne 2 ] || ! valid_session_type \ "${session_type}"; then usage 1>&2 return 1 -- cgit v0.9.1