symlink enhancements

* runon -l now install symlink
* install -u now removes all found symlinks to runon
This commit is contained in:
2021-05-01 16:28:24 +02:00
parent 96418fbbb5
commit 8b08aab4e7
3 changed files with 22 additions and 2 deletions

View File

@ -89,6 +89,13 @@ elif [ "$op" = "installdev" ]; then
do_exec ln -s -f $(realpath runon) $bin_dir/
do_exec ln -s -f $(realpath runon.conf) $config_dir/
elif [ "$op" = "uninstall" ]; then
# find all symlinks targetting to runon, and remove them
find $bin_dir -type l | while read l; do
if [ "$(readlink $l)" = "runon" ]; then
do_exec rm $l
fi
done
do_exec rm -f $bin_dir/runon
do_exec rm -f $config_dir/runon.conf
test -d $bin_dir && do_exec rmdir --parents --ignore-fail-on-non-empty $bin_dir 2> /dev/null