mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* screen-launcher-install: no longer need the pruning code, since we just
call screen-launcher-uninstall
This commit is contained in:
parent
6be48598da
commit
c77b5230ab
1 changed files with 1 additions and 16 deletions
|
@ -23,23 +23,8 @@ install_screen_launcher() {
|
||||||
dest=$1
|
dest=$1
|
||||||
launcher="/usr/bin/screen-launcher"
|
launcher="/usr/bin/screen-launcher"
|
||||||
launcher_line="[ -x $launcher ] && $launcher"
|
launcher_line="[ -x $launcher ] && $launcher"
|
||||||
# We have to make sure screen is called last
|
|
||||||
pos=$(( $(grep -ns "$launcher" "$dest" | sed 's/:.*$//' | head -1) ))
|
|
||||||
do=0
|
|
||||||
if [ $pos -gt 0 ]; then
|
|
||||||
if [ $pos -lt $(( $(wc -l "$dest" | sed "s/ .*$//") -2)) ]; then
|
|
||||||
# We have to reposition the line at the end
|
|
||||||
# First remove it
|
|
||||||
sed -i '/\/usr\/bin\/screen-launcher$/d' "$dest"
|
|
||||||
do=1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
do=1
|
|
||||||
fi
|
|
||||||
# Add it at the end
|
# Add it at the end
|
||||||
if [ $do -eq 1 ]; then
|
|
||||||
echo "$launcher_line" >> "$dest"
|
echo "$launcher_line" >> "$dest"
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sanitize the environment
|
# Sanitize the environment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue