Uninstall unactivated service symlink
This commit is contained in:
parent
31a79b6238
commit
3546da3d2f
1 changed files with 6 additions and 1 deletions
|
@ -282,6 +282,9 @@ install_service ()
|
||||||
local activate
|
local activate
|
||||||
source="${repository}/$1"
|
source="${repository}/$1"
|
||||||
activate=$2
|
activate=$2
|
||||||
|
|
||||||
|
[ -z "$activate" ] && activate=0
|
||||||
|
|
||||||
local ret
|
local ret
|
||||||
[ ! -f "$source" ] && { error "$1 not found"; return; }
|
[ ! -f "$source" ] && { error "$1 not found"; return; }
|
||||||
|
|
||||||
|
@ -306,10 +309,12 @@ install_service ()
|
||||||
#Deactivate service
|
#Deactivate service
|
||||||
if [ $activate -eq 1 ]
|
if [ $activate -eq 1 ]
|
||||||
then
|
then
|
||||||
printf " -> Deactivate %s : " "$basename"
|
printf " -> Deactivate %s : " "$basename"
|
||||||
ret=$(systemctl --user disable "${basename}" 2>&1)
|
ret=$(systemctl --user disable "${basename}" 2>&1)
|
||||||
[[ $? -ne 0 ]] && { error "$ret"; return; }
|
[[ $? -ne 0 ]] && { error "$ret"; return; }
|
||||||
printf "\e[32mdone\e[0m\n"
|
printf "\e[32mdone\e[0m\n"
|
||||||
|
else
|
||||||
|
private:remove_symblink "${SYD_DIRECTORY}/${basename}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in a new issue