aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeodarZ <neodarz@neodarz.net>2017-08-24 15:20:18 +0200
committerNeodarZ <neodarz@neodarz.net>2017-08-24 15:20:18 +0200
commite988fb4e973d6d08d4b41d364fa9bbfbcad512ad (patch)
tree48fcbe254b0b8989905af8334b37922b4522d35d
parent3a759ddfa63901da5ecfdbb6795a889ef626558a (diff)
downloaddotfiles_ascii-e988fb4e973d6d08d4b41d364fa9bbfbcad512ad.tar.xz
dotfiles_ascii-e988fb4e973d6d08d4b41d364fa9bbfbcad512ad.zip
Add security for install only services from selected folder
-rwxr-xr-xstow-services8
1 files changed, 7 insertions, 1 deletions
diff --git a/stow-services b/stow-services
index 23f1ed9..1b28c0c 100755
--- a/stow-services
+++ b/stow-services
@@ -1,7 +1,13 @@
serviceName=$(echo $1 | cut -d'/' -f'2')
if [[ $1 =~ "/" && $serviceName != "" ]]; then
if [ -f "$1" ]; then
- sudo ln -s $(readlink -f $1) /usr/lib/systemd/user/$serviceName
+ if [[ $(echo $1 | cut -d'/' -f1) == "services" ]]; then
+ sudo ln -s $(readlink -f $1) /usr/lib/systemd/user/$serviceName
+ elif [[ $(echo $1 | cut -d'/' -f1) == "services-root" ]]; then
+ sudo ln -s $(readlink -f $1) /usr/lib/systemd/system/$serviceName
+ else
+ echo "You can only install service from services and services-root folder !"
+ fi
else
echo "Warning ! You must be in the dotfile folder to execute this !"
echo "Sorry the file $1 not found !"