aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 !"