-
Notifications
You must be signed in to change notification settings - Fork 0
/
customiso
executable file
·32 lines (25 loc) · 1.15 KB
/
customiso
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#
# Script d'utilisation de Customiso.
checkDependencies() {
command -v "python3" >/dev/null 2>&1 || { echo >&2 "I require Python but it's not installed. Aborting."; exit 1; };
if ! python3 -m pip --help >/dev/null 2>&1; then echo "I require Python Pip but it's not installed. Aborting."; exit 1; fi
if ! python3 -m venv --help >/dev/null 2>&1; then echo "I require Python Venv but it's not installed. Aborting."; exit 1; fi
command -v "dpkg" >/dev/null 2>&1 || { echo >&2 "I require Dpkg but it's not installed. Aborting."; exit 1; }
command -v "apt" >/dev/null 2>&1 || { echo >&2 "I require Apt but it's not installed. Aborting."; exit 1; }
}
setup() {
while ! source /var/lib/customiso/pyenv/bin/activate >/dev/null 2>&1; do
python3 -m venv /var/lib/customiso/pyenv
source /var/lib/customiso/pyenv/bin/activate
python3 -m pip install -r /usr/lib/customiso/requirements.txt
echo -e "\n\e[36mCustomiso est prêt !\e[0m\n"; exit 0
done
}
if [ "$1" == "check" ]; then
checkDependencies
setup
echo -e "Tout est en ordre.\n"; exit 0
fi
setup
python3 /usr/lib/customiso/src/customiso "$@"