aboutsummaryrefslogtreecommitdiff
path: root/03/install.sh
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 05:31:06 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 06:14:42 +0000
commit9e1d304cac5367c3dbb1ca14700736680bd3a804 (patch)
tree31f328747acb934d365d423adfda144818ff5ad4 /03/install.sh
downloadlab-01-05-master.tar.gz
publishHEADmaster
Diffstat (limited to '03/install.sh')
-rwxr-xr-x03/install.sh41
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
12if [ "$(id -u)" != 0 ]; then
13 echo "$0: permission denied"
14 exit 1
15fi
16
17cd "$(dirname "$0")"
18
19PREFIX=/usr/local/practice3
20
21set -xeu
22
23install -o root -g root -m 755 -d $PREFIX
24install -o root -g root -m 755 -d $PREFIX/bin
25install -o root -g root -m 700 -d $PREFIX/etc
26install -o root -g root -m 700 -d $PREFIX/etc/acl
27install -o root -g root -m 700 -d $PREFIX/confdata
28install -o root -g root -m 700 -d $PREFIX/log
29
30install -o root -g root -m 6711 passwdctl $PREFIX/bin/passwdctl
31install -o root -g root -m 6711 shell-dac $PREFIX/bin/shell-dac
32install -o root -g root -m 6711 shell-mac $PREFIX/bin/shell-mac
33
34umask 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
39exit 0
40
41## install.sh ends here