From 9e1d304cac5367c3dbb1ca14700736680bd3a804 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Wed, 11 Nov 2026 08:31:06 +0300 Subject: publish --- 03/install.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 03/install.sh (limited to '03/install.sh') 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 @@ +#!/bin/sh +## install.sh +# +# Copyright (C) 2026 by Martin Michalec +# +# SPDX-License-Identifier: MIT +# +## Commentary: +# +## Code: + +if [ "$(id -u)" != 0 ]; then + echo "$0: permission denied" + exit 1 +fi + +cd "$(dirname "$0")" + +PREFIX=/usr/local/practice3 + +set -xeu + +install -o root -g root -m 755 -d $PREFIX +install -o root -g root -m 755 -d $PREFIX/bin +install -o root -g root -m 700 -d $PREFIX/etc +install -o root -g root -m 700 -d $PREFIX/etc/acl +install -o root -g root -m 700 -d $PREFIX/confdata +install -o root -g root -m 700 -d $PREFIX/log + +install -o root -g root -m 6711 passwdctl $PREFIX/bin/passwdctl +install -o root -g root -m 6711 shell-dac $PREFIX/bin/shell-dac +install -o root -g root -m 6711 shell-mac $PREFIX/bin/shell-mac + +umask 177 +[ ! -f $PREFIX/etc/passwd ] && touch $PREFIX/etc/passwd +[ ! -f $PREFIX/log/passwd.log ] && touch $PREFIX/log/passwd.log +[ ! -f $PREFIX/log/confdata.log ] && touch $PREFIX/log/confdata.log + +exit 0 + +## install.sh ends here -- cgit v1.3.1