1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07:00

don't screen if unscreen failed

This commit is contained in:
Connor Olding 2016-01-05 05:38:34 -08:00
parent 6784de8750
commit 0aaf8ead84
2 changed files with 5 additions and 2 deletions

View File

@ -7,9 +7,11 @@ screeny() {
pushd "$home" >/dev/null
local name="${1:?needs arg for screen name}"
shift
~/sh/unscreen "$name"
~/sh/unscreen "$name" || return 1
echo screen -S "$name" -dm sudo -Hu "$user" "$@"
screen -S "$name" -dm sudo -Hu "$user" "$@"
popd "$home" >/dev/null
return 0
}
screeny "$@"

View File

@ -4,8 +4,9 @@ unscreen() {
local pids="$(screen -ls | fgrep "$1" | cut -d. -f1)"
for pid in $=pids; do
local ppid="$(ps h --ppid "$pid" -o pid)"
kill "$ppid"
kill "$ppid" || return 1
done
return 0
}
unscreen "$@"