File: setup-file-saver.sh

package info (click to toggle)
gtksourceview4 4.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,840 kB
  • sloc: ansic: 49,715; sh: 4,917; xml: 1,302; makefile: 1,010; python: 230; perl: 52; yacc: 45; cobol: 20; objc: 19; sed: 16; fortran: 14; cpp: 8; ml: 3
file content (27 lines) | stat: -rwxr-xr-x 697 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# This script is used to setup some special directory structures, permissions
# for the file saver test.

UNOWNED_DIRECTORY="/tmp/gtksourceview-file-saver-unowned"
UNOWNED_FILE="/tmp/gtksourceview-file-saver-unowned/gtksourceview-file-saver-test.txt"

UNOWNED_GROUP="/tmp/gtksourceview-file-saver-unowned-group.txt"

if [ -f "$UNOWNED_FILE" ]; then
	sudo rm "$UNOWNED_FILE"
fi

if [ -d "$UNOWNED_DIRECTORY" ]; then
	sudo rmdir "$UNOWNED_DIRECTORY"
fi

mkdir "$UNOWNED_DIRECTORY"
touch "$UNOWNED_FILE"

sudo chown nobody:nobody "$UNOWNED_DIRECTORY"

sudo touch "$UNOWNED_GROUP"
sudo chgrp root "$UNOWNED_GROUP"
sudo chmod u+w,g+w,o-rwx "$UNOWNED_GROUP"
sudo chown $USER "$UNOWNED_GROUP"