1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 05:49:02 -08:00
rc/sh/screeny

19 lines
436 B
Text
Raw Normal View History

2015-12-06 12:35:57 -08:00
#!/usr/bin/env zsh
2021-07-29 00:37:35 -07:00
# YES_ZSH
2015-12-06 12:35:57 -08:00
screeny() {
local user="${1:?needs arg for user name}"
shift
home="/home/$user"
pushd "$home" >/dev/null
local name="${1:?needs arg for screen name}"
shift
2016-01-05 05:38:34 -08:00
~/sh/unscreen "$name" || return 1
echo screen -S "$name" -dm sudo -Hu "$user" "$@"
2015-12-06 12:35:57 -08:00
screen -S "$name" -dm sudo -Hu "$user" "$@"
popd "$home" >/dev/null
2016-01-05 05:38:34 -08:00
return 0
2015-12-06 12:35:57 -08:00
}
2021-07-29 00:37:35 -07:00
[ "${SOURCING:-0}" -gt 0 ] || screeny "$@"