summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2018-06-01 22:27:29 (EDT)
committer P. J. McDermott <pj@pehjota.net>2018-06-04 01:32:49 (EDT)
commit5feae401e3b03cefa1193b2b73fe919990aca016 (patch)
tree8459460ef4530d5978a24378d617ea34e2f725f3
parentf4aacc39f0dc1090b3082c2a445a0ea2e89ac84c (diff)
downloadhomerc-5feae401e3b03cefa1193b2b73fe919990aca016.zip
homerc-5feae401e3b03cefa1193b2b73fe919990aca016.tar.gz
homerc-5feae401e3b03cefa1193b2b73fe919990aca016.tar.bz2
bin/rc: Fix svc script dir and session type validation
-rwxr-xr-xbin/rc6
1 files changed, 3 insertions, 3 deletions
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