* motd+shell, screen: clean up temp file

Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-04-29 16:11:53 -05:00
commit 7a40cd6b01
3 changed files with 5 additions and 4 deletions

3
debian/changelog vendored
View file

@ -2,8 +2,9 @@ screen-profiles (1.53) unreleased; urgency=low
* screen: some users gripe about the default launched window being
called "motd+shell", LP: #369397
* motd+shell, screen: clean up temp file
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 29 Apr 2009 15:59:51 -0500
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 29 Apr 2009 16:11:29 -0500
screen-profiles (1.52-0ubuntu1) karmic; urgency=low

View file

@ -18,4 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[ -r /etc/motd ] && cat /etc/motd
[ -n "$1" -a -w "$1" ] && rm -f "$1" 2>/dev/null
[ -n "$SHELL" -a -x "$SHELL" ] && exec "$SHELL" || exec /bin/sh

5
screen
View file

@ -81,11 +81,10 @@ fi
if [ "$#" = "0" ]; then
# Create a temporary config file *with* the default windows
# but if we refresh, we'll just source the profile, without
temp=$(mktemp screen-profiles-XXXXXXXX)
trap "rm -f $temp 2>/dev/null || true" EXIT HUP INT QUIT TERM
temp=$(mktemp -t screen-profiles-XXXXXXXX)
cat "$HOME/.screen-profiles/profile" "$HOME/.screen-profiles/windows" > "$temp"
[ -n "$SHELL" -a -x "$SHELL" ] || SHELL="/bin/sh"
exec /usr/bin/screen.real -c "$temp" $SHELL /usr/bin/motd+shell
exec /usr/bin/screen.real -c "$temp" $SHELL /usr/bin/motd+shell "$temp"
else
exec /usr/bin/screen.real -c "$HOME/.screen-profiles/profile" "$@"
fi