diff options
| author | 2026-11-11 05:31:06 +0000 | |
|---|---|---|
| committer | 2026-11-11 06:14:42 +0000 | |
| commit | 9e1d304cac5367c3dbb1ca14700736680bd3a804 (patch) | |
| tree | 31f328747acb934d365d423adfda144818ff5ad4 /03/install.sh | |
| download | lab-01-05-9e1d304cac5367c3dbb1ca14700736680bd3a804.tar.gz | |
Diffstat (limited to '03/install.sh')
| -rwxr-xr-x | 03/install.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/03/install.sh b/03/install.sh new file mode 100755 index 0000000..8cd2aa1 --- /dev/null +++ b/03/install.sh | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ## install.sh | ||
| 3 | # | ||
| 4 | # Copyright (C) 2026 by Martin Michalec <martin@michalec.dev> | ||
| 5 | # | ||
| 6 | # SPDX-License-Identifier: MIT | ||
| 7 | # | ||
| 8 | ## Commentary: | ||
| 9 | # | ||
| 10 | ## Code: | ||
| 11 | |||
| 12 | if [ "$(id -u)" != 0 ]; then | ||
| 13 | echo "$0: permission denied" | ||
| 14 | exit 1 | ||
| 15 | fi | ||
| 16 | |||
| 17 | cd "$(dirname "$0")" | ||
| 18 | |||
| 19 | PREFIX=/usr/local/practice3 | ||
| 20 | |||
| 21 | set -xeu | ||
| 22 | |||
| 23 | install -o root -g root -m 755 -d $PREFIX | ||
| 24 | install -o root -g root -m 755 -d $PREFIX/bin | ||
| 25 | install -o root -g root -m 700 -d $PREFIX/etc | ||
| 26 | install -o root -g root -m 700 -d $PREFIX/etc/acl | ||
| 27 | install -o root -g root -m 700 -d $PREFIX/confdata | ||
| 28 | install -o root -g root -m 700 -d $PREFIX/log | ||
| 29 | |||
| 30 | install -o root -g root -m 6711 passwdctl $PREFIX/bin/passwdctl | ||
| 31 | install -o root -g root -m 6711 shell-dac $PREFIX/bin/shell-dac | ||
| 32 | install -o root -g root -m 6711 shell-mac $PREFIX/bin/shell-mac | ||
| 33 | |||
| 34 | umask 177 | ||
| 35 | [ ! -f $PREFIX/etc/passwd ] && touch $PREFIX/etc/passwd | ||
| 36 | [ ! -f $PREFIX/log/passwd.log ] && touch $PREFIX/log/passwd.log | ||
| 37 | [ ! -f $PREFIX/log/confdata.log ] && touch $PREFIX/log/confdata.log | ||
| 38 | |||
| 39 | exit 0 | ||
| 40 | |||
| 41 | ## install.sh ends here | ||
