File: fake_home.sh

package info (click to toggle)
ephoto 1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,272 kB
  • sloc: ansic: 14,327; sh: 4,692; makefile: 178; sed: 16
file content (15 lines) | stat: -rwxr-xr-x 295 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

cleanup () {
    [ -n "$temp_HOME" ] && rm -r "$temp_HOME"
    [ -n "$temp_XDG_RUNTIME_DIR" ] && rm -r "$temp_XDG_RUNTIME_DIR"
}

trap cleanup EXIT

temp_HOME=$(mktemp -d)
temp_XDG_RUNTIME_DIR=$(mktemp -d)

env HOME="$temp_HOME" \
    XDG_RUNTIME_DIR="$temp_XDG_RUNTIME_DIR" \
    $*