From 94fb9171c3ad0fc51580e4007e2ff2dbbd8a0388 Mon Sep 17 00:00:00 2001 From: gbaconni Date: Sun, 7 Nov 2021 15:10:48 +0100 Subject: [PATCH] Add initial version of Bonus --- bonus.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 bonus.sh diff --git a/bonus.sh b/bonus.sh new file mode 100755 index 0000000..5dc0857 --- /dev/null +++ b/bonus.sh @@ -0,0 +1,73 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# bonus.sh :+: :+: :+: # +# +:+ +:+ +:+ # +# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# # +# Updated: 2021/11/07 15:10:12 by gbaconni ### lausanne.ch # +# # +# **************************************************************************** # + +PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +ft_mariadb () +{ + return 0 +} + +ft_apache () +{ + return 0 +} + +ft_php () +{ + return 0 +} + +ft_wordpress () +{ + return 0 +} + +ft_update () +{ + temp=(mktemp /tmp/.42.XXXXXXXXXXXXXXXXXXXXX) + #curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/update.sh' + curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/update.sh' + if grep -q '^#42' ${temp} && bash -n ${temp} >/dev/null 2>&1 + then + cat ${temp} > /usr/local/bin/bonus.sh + fi + rm -f ${temp} + return 0 +} + +ft_install () +{ + ft_mariadb + ft_apache + ft_php + ft_wordpress + return 0 +} + +main () +{ + case "${1}" in + -u) + ft_update + ;; + *) + ft_install + ;; + esac + return 0 +} + +main $@ +exit $? + +#42