mirror of
https://gitlab.com/JKANetwork/JKArch.git
synced 2026-02-17 18:51:32 +01:00
Trying things
This commit is contained in:
@@ -8,16 +8,18 @@
|
|||||||
## $4 -> Command to run
|
## $4 -> Command to run
|
||||||
## $5 -> Is a "various-sentence command"? (1 -> First / Not lastest, 2 -> Last )
|
## $5 -> Is a "various-sentence command"? (1 -> First / Not lastest, 2 -> Last )
|
||||||
function comm {
|
function comm {
|
||||||
|
local command
|
||||||
|
command=$4
|
||||||
# First complete the command, if necessary
|
# First complete the command, if necessary
|
||||||
if [[ $3 == "chroot" ]];then
|
if [[ $3 == "chroot" ]];then
|
||||||
$4 = "chroot /mnt /bin/bash -c \"$4\""
|
command="chroot /mnt /bin/bash -c \"$4\""
|
||||||
else if [[ $3 == "chuser" ]];then
|
else if [[ $3 == "chuser" ]];then
|
||||||
$4 = "chroot /mnt /bin/bash -c \"su $nameuser -c \"$4\" \" "
|
command="chroot /mnt /bin/bash -c \"su $nameuser -c \"$4\" \" "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make silent if it has to be
|
# Make silent if it has to be
|
||||||
if [[ $2 != "0" ]];then
|
if [[ $2 != "0" ]];then
|
||||||
$4 = "$4 >/dev/null"
|
command="$command >/dev/null"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for multisentence command and run
|
# Check for multisentence command and run
|
||||||
@@ -25,7 +27,7 @@ function comm {
|
|||||||
echo "[ RUNNING ] $1"
|
echo "[ RUNNING ] $1"
|
||||||
fi
|
fi
|
||||||
#Run command. (Command is $4)
|
#Run command. (Command is $4)
|
||||||
$4
|
$command
|
||||||
|
|
||||||
# Update multiSentence var
|
# Update multiSentence var
|
||||||
if [[ $5 == "1" ]];then
|
if [[ $5 == "1" ]];then
|
||||||
|
|||||||
Reference in New Issue
Block a user