#!/bin/sh # ===================================================================== # Projet : DARKCONTAINER # Fichier : lib/nodeService # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # https://www.perplexity.ai # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== if ! type "shInclude" > /dev/null 2>&1; then racineSh="${racineSh:-/etc/darksh}"; . "$racineSh/lib/shTools"; shDebugEnable="1";fi rootDarkContainer="${rootDarkContainer:-/etc/darkcontainer}" [ ! -d "$rootDarkContainer" ] && shDebug 0 "exit cause rootDarkContainer is not dir:$rootDarkContainer" >&2 && exit 0 #|-------------------------------------------------------------| #| which "base" tools : cp | rm | echo | head | tail | #|-------------------------------------------------------------| # &&&&& #|-----------------------------------------------------------------------| #| which "directory" tools : mkdir | chmod | chgrp | mount | umount | #|-----------------------------------------------------------------------| # &&&&& #|------------------------------------------------------------------------------------| #| which "user right" tools : chmod | chown | chgrp | groupadd | useradd | chroot | #|------------------------------------------------------------------------------------| $(shInclude $rootDarkContainer/which/lib/base) && $(shInclude $rootDarkContainer/which/lib/systemctl) && $(shInclude $rootDarkContainer/which/lib/userRight) $(shInclude $rootDarkContainer/lib/chroot) && $(shInclude $rootDarkContainer/lib/rsyslog) # chroot function $( shInclude ${rootDarkContainer}/lib/chroot-apt ) $( shInclude $rootDarkContainer/lib/services ) $( shInclude $rootDarkContainer/lib/nodeService ) cmdStartStopDaemon="$(which start-stop-daemon 2>/dev/null )" cmdSh="$(which sh)" #pChrootDir="$pChrootDir" pName="$pName" pUser="$pUser" pGroup="$pGroup"\ #pCacheDir="$pCacheDir" pServiceInfo="$pServiceInfo" cmdDaemon="$cmdDaemon"\ #pLibFiles="$pLibFiles" pLibFolders="$pLibFolders" pCopyLib="$pCopyLib" pDirStruct="$pDirStruct"\ # nodeService_chroot_init_apt nodeService_chroot_init_apt() { local log="nodeService_chroot_init:" shErrorOnMissing "pChrootDir pName pUser pGroup" shErrorOnMissing "pCacheDir pServiceInfo cmdDaemon pLibFiles" shWarnOnMissing "pCopyLib pLibFolders pDirStruct" shDebug 1 ""$log" $pName" racineSh="$racineSh" rootDarkContainer="$rootDarkContainer" sh "$rootDarkContainer/bin/container" force-stop "$( echo $pChrootDir | base64 )" if [ -z "$pChrootDir" ];then shDebug 0 "$log usage : [${rootDarkContainer}/bin/initApt] pChrootDir pName pUser pGroup pBaseDir pUserComment" else shDebug 2 "$log [ $pChrootDir ] forBuild=${forBuild} $pName $pUser $pGroup $pBaseDir $pUserComment" apt_init_clear "$pChrootDir" "$pName" "$pUser" "$pGroup" "$pBaseDir" "$pUserComment" "-U -r" fi #pChrootDir="$pChrootDir" pName="$pName" pUser="$pUser" pGroup="$pGroup"\ #pCacheDir="$pCacheDir" pServiceInfo="$pServiceInfo"\ # chroot_init # chroot_init_install }