Move wi-restricted function to base and fix bash version execution
This commit is contained in:
21
init.sh
21
init.sh
@ -1,7 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! "$BASH_VERSION" ] ; then
|
if [ ! "$BASH_VERSION" ] ; then
|
||||||
bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
|
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
||||||
|
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $USER != "root" ]]
|
||||||
|
then
|
||||||
|
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
||||||
|
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -292,15 +300,6 @@ wx-repeat() {
|
|||||||
printf "%s" "${spaces// /$str}"
|
printf "%s" "${spaces// /$str}"
|
||||||
}
|
}
|
||||||
|
|
||||||
wi-restricted(){
|
|
||||||
if [[ $USER != "root" ]]
|
|
||||||
then
|
|
||||||
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
|
||||||
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wi-start(){
|
wi-start(){
|
||||||
wi-header "Warén Init" h1
|
wi-header "Warén Init" h1
|
||||||
|
|
||||||
@ -326,8 +325,6 @@ wi-stop (){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wi-restricted "$0 $1 $2"
|
|
||||||
|
|
||||||
if [[ ! -f /bin/jq ]]
|
if [[ ! -f /bin/jq ]]
|
||||||
then
|
then
|
||||||
apt update &> /dev/null
|
apt update &> /dev/null
|
||||||
|
12
src/base.sh
12
src/base.sh
@ -1,7 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! "$BASH_VERSION" ] ; then
|
if [ ! "$BASH_VERSION" ] ; then
|
||||||
bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
|
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
||||||
|
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $USER != "root" ]]
|
||||||
|
then
|
||||||
|
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
||||||
|
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -18,8 +26,6 @@ wiNormal=$(tput sgr0)
|
|||||||
|
|
||||||
{{ CODES }}
|
{{ CODES }}
|
||||||
|
|
||||||
wi-restricted "$0 $1 $2"
|
|
||||||
|
|
||||||
if [[ ! -f /bin/jq ]]
|
if [[ ! -f /bin/jq ]]
|
||||||
then
|
then
|
||||||
apt update &> /dev/null
|
apt update &> /dev/null
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
wi-restricted(){
|
|
||||||
if [[ $USER != "root" ]]
|
|
||||||
then
|
|
||||||
sudo curl https://waren.io/init.sh -o $PWD/init.sh
|
|
||||||
sudo bash $PWD/init.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
Reference in New Issue
Block a user