clean-> trine.sh
trine™ is a concept application that is used to interact with system resources. The name is subject to change because this was only used as a project alias while it was under construction. This clean drills down on one component of TRINE™ in particular that has to do with mounted storage devices, and it performs required teardown oriented tasks upon the termination of the machine at shutdown. Clean tasks are not self manifesting, and they are to be governed by dugout. This will reset the blocks mounted upon every reboot so you don't have to rely on any abstractions to manage your virtual file-systems attached to your machine. If the scope of what is considered a 'clean routine' changes, then the scope of what this clean unit performs can be expanded or altered to meet your needs.
#!/bin/sh
###############################################################################
## COPYRIGHT (C) 2022-2023 NEW ENTITY OPERATIONS INC. ALL RIGHTS RESERVED
## CREATED: 2022/02/13
## INSTANCE: clean/trine.sh
## MODIFIED: 2023/12/31
## OVERVIEW: perform required teardown oriented tasks for TRINE in an
## automated way at startup. This will reset the blocks mounted upon every
## reboot
## HISTORY: VERSION 1.6
## -> 2022/02/13 (VERSION 1.0) Development
## -> 2023/11/20 (VERSION 1.1)
## -> 2023/12/15 (VERSION 1.2)
## -> 2023/12/17 (VERSION 1.3)
## -> 2023/12/18 (VERSION 1.4)
## -> 2023/12/19 (VERSION 1.5)
## -> 2023/12/31 (VERSION 1.6) Production
###############################################################################
## Add filesystem routines that an be run as a batch below:
## This file sources paths from $dugout_dir/system_paths.dugout
###############################################################################
## Source the wrappers
. "$wrappers_generic"
## ACS CHECK
helper_acs_check "clean"
## clean any never-ending maldetect logs
if [ "$(id -u)" -eq "${SCRIPT_ACS_RUNNER_CLEAN}" ]; then
printf "%b" "${tmodReset}"
## Special instance location: TRINE
SLUG="${PATH_BLOCKS_MOUNTED}"
## Clear past drive device history
if [ -z "${SLUG}" ]; then
printf "%b* * You have to provide a valid blocks_mounted.ds instance to modify.\n" "${tmodReset}"
printf "Provided location: was-> %s\n" "${SLUG}"
else
if [ -f "${SLUG}" ]; then
perform_removal_generic "${SLUG}"
perform_creation_file "${SLUG}"
## Remake the required permissions
perform_modification_owner_generic "${BLUEPRINT_DUGOUT_RESTRICTED}" "${SLUG}"
perform_modification_permissions_generic "660" "${SLUG}"
printf "%b-> Reestablished the blocks_mounted.ds instance within TRINE.\n" "${tmodReset}"
else
printf "%dThe provided slug: %s-> could not be located.\n" "${tmodReset}" "${SLUG}"
fi
fi
else
printf "%b* * You need to be root to be able to perform a clean-related task.\n" "${tmodReset}"
fi