#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : install_initd # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](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](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. # ===================================================================== racine="/etc/darkmake" . /etc/darkcontainer/lib/shTools shDebug "[ INFO ] $racine/web/apache2/global/vars" $(shInclude $racine/web/apache2/global/vars) shLog="$pName-install:" shDebugEnable="1" shDebug "$*" shDebug "[ INFO ] $racine/chroot/lib-sh/chroot && $racine/initd/lib-sh/initd && shInclude $racine/rsyslog/lib-sh/rsyslog" $(shInclude $racine/chroot/lib-sh/chroot) && $(shInclude $racine/initd/lib-sh/initd) && $(shInclude $racine/rsyslog/lib-sh/rsyslog) #|-----------------------------------------------------------------------| #| which "directory" tools : mkdir | chmod | chgrp | mount | umount | #|-----------------------------------------------------------------------| shDebug "[ INFO ] /etc/darkcontainer/which/lib/directory" $(shInclude /etc/darkcontainer/which/lib/directory) shDebug "[ INFO ] which :sh touch kill $pName" cmdSh="$(which sh)" cmdTouch="$(which touch)" cmdKill="$(which kill)" if [ -z "$cmdDaemon" ];then cmdDaemon="$(which $pName)";fi if [ -z "$cmdDaemon" ];then cmdDaemon="$pFolder/$pName";fi shDebug "[ INFO ] initd_create $pName" initd_create "$pName" shDebug "[ INFO ] chroot_init $pChrootDir $pName $pUser $pGroup $pCacheDir $pServiceInfo" chroot_init "$pChrootDir" "$pName" "$pUser" "$pGroup" "$pCacheDir" "$pServiceInfo" shDebug "[ INFO ] rsyslog_init $pName $pChrootDir " rsyslog_init $pName $pChrootDir shDebug "[ INFO ] chroot_install" chroot_install $pChrootDir /dev/null chroot_install $pChrootDir /dev/random chroot_install $pChrootDir /dev/urandom chroot_install $pChrootDir /etc/resolv.conf chroot_install $pChrootDir $cmdSh for pLibFolder in $(echo $pLibFolders);do chroot_install $pChrootDir $pLibFolder done for pLibFile in $(echo $pLibFiles);do chroot_install $pChrootDir $pLibFile done for pEmptyFolder in $(echo $pEmptyFolders);do $cmdMkdir -p $pChrootDir/$pEmptyFolder done if [ -d "/usr/lib/x86_64-linux-gnu" ];then usrLib="/usr/lib/x86_64-linux-gnu" else if [ -d "/usr/lib/i386-linux-gnu" ];then usrLib="/usr/lib/i386-linux-gnu" else usrLib="" fi fi if [ -d "/lib/x86_64-linux-gnu" ];then lib="/lib/x86_64-linux-gnu" else if [ -d "/lib/i386-linux-gnu" ];then lib="/lib/i386-linux-gnu" else lib="" fi fi if [ -z "$lib" ];then shDebug "[ ERROR ] lib empty : $lib" else shDebug "[ INFO ] lib : $lib" # shDebug "[ INFO ] chroot_install $lib/libnss_dns.so.2" # chroot_install $pChrootDir $lib/libnss_dns.so.2 # shDebug "[ INFO ] chroot_install $lib/libnss_files.so.2" # chroot_install $pChrootDir $lib/libnss_files.so.2 fi if [ -z "$usrLib" ];then shDebug "[ ERROR ] usr lib empty : $usrLib" else shDebug "[ INFO ] user lib : $usrLib" # opensslLib="$(find $usrLib -maxdepth 1 | grep openssl)" # shDebug "[ INFO ] chroot_install $opensslLib" # chroot_install $pChrootDir $opensslLib fi if [ -z "$pStart" ];then pStart="$cmdDaemon -- $pParamStart" fi #initd_install $pName $pServiceInfo $pServiceDoc $pUser $pGroup $pChrootDir $listMountFolder $ExecStart $ExecStartPre $ExecStop $ExecReload initd_install "$pName" "$pServiceInfo" "$pServiceDoc" "$pUser" "$pGroup" "$pChrootDir" "$pMountFolders" "$pStart" if [ -z "$pStartDebug" ];then pStartDebug="$cmdDaemon $pParamStartDebug" fi #initd_install_debug "$debugFile" "$pName" "$pChrootDir" "$pUser" "$pGroup" "$ExecStart" "$listMountFolder" initd_install_debug "$pDebugFile" "$pName" "$pChrootDir" "$pUser" "$pGroup" "$pStartDebug" "$pMountFolders"