Install bootstrap instead of saving in /tmp/.42
This commit is contained in:
35
bootstrap.sh
35
bootstrap.sh
@@ -6,7 +6,7 @@
|
|||||||
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2021/11/04 10:58:16 by gbaconni #+# #+# #
|
# Created: 2021/11/04 10:58:16 by gbaconni #+# #+# #
|
||||||
# Updated: 2021/11/07 23:30:49 by gbaconni ### lausanne.ch #
|
# Updated: 2021/11/08 09:42:55 by gbaconni ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@@ -124,7 +124,20 @@ ft_bonus ()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
main ()
|
ft_update ()
|
||||||
|
{
|
||||||
|
temp=$(mktemp /tmp/.42.XXXXXXXXXXXXXXXXXXXXX)
|
||||||
|
#curl -sLo ${temp} 'https://42url.com/QajQzFZr'
|
||||||
|
curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/bootstrap.sh'
|
||||||
|
if grep -q '^#42' ${temp} && bash -n ${temp} >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
cat ${temp} > /usr/local/bin/bootstrap.sh
|
||||||
|
fi
|
||||||
|
rm -f ${temp}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ft_install ()
|
||||||
{
|
{
|
||||||
port=${1-4242}
|
port=${1-4242}
|
||||||
user=${2-marvin}
|
user=${2-marvin}
|
||||||
@@ -144,8 +157,26 @@ main ()
|
|||||||
ft_monitoring ${user}
|
ft_monitoring ${user}
|
||||||
ft_bonus ${user}
|
ft_bonus ${user}
|
||||||
echo "That's all Folks!"
|
echo "That's all Folks!"
|
||||||
|
}
|
||||||
|
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
case "${1}" in
|
||||||
|
-u)
|
||||||
|
ft_update
|
||||||
|
(sleep 3; bash -x $0) &
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
port=${1-4242}
|
||||||
|
user=${2-marvin}
|
||||||
|
ft_install ${port} ${user}
|
||||||
|
;;
|
||||||
|
esac
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
#42
|
||||||
|
|||||||
@@ -530,8 +530,8 @@ d-i debian-installer/exit/poweroff boolean true
|
|||||||
# packages and run commands in the target system.
|
# packages and run commands in the target system.
|
||||||
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
|
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
|
||||||
d-i preseed/late_command string \
|
d-i preseed/late_command string \
|
||||||
in-target /usr/bin/curl -sLo /tmp/.42 'https://42url.com/QajQzFZr'; \
|
in-target /usr/bin/curl -sLo /usr/local/bin/bootstrap.sh 'https://42url.com/QajQzFZr'; \
|
||||||
in-target /bin/bash -x /tmp/.42 4242 gbaconni; \
|
in-target /bin/bash -x /usr/local/bin/bootstrap.sh 4242 gbaconni; \
|
||||||
lvremove -f /dev/LVMGroup/free >/dev/null 2>&1; \
|
lvremove -f /dev/LVMGroup/free >/dev/null 2>&1; \
|
||||||
echo "That's all Folks!"
|
echo "That's all Folks!"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user