-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
63 lines (60 loc) · 1.93 KB
/
Vagrantfile
File metadata and controls
63 lines (60 loc) · 1.93 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Vagrant.configure("2") do |config|
config.vm.box = "debian/bookworm64"
config.vbguest.auto_update = false
config.vm.network "forwarded_port", guest: 8080, host: 8081
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y python3 python3-pip nano tree python3-flask
chmod +x /vagrant/lsit.py
ln -sf /vagrant/lsit.py /usr/local/bin/lsit
echo "0 0 * * * root /usr/local/bin/lsit --format json" > /etc/cron.d/lsit_audit
cat > /etc/profile.d/lsit-welcome.sh << 'EOF'
#!/bin/bash
[[ $- == *i* ]] || return
while true; do
echo ""
echo " ╔══════════════════════════════════════════╗"
echo " ║ LSIT - Linux System Inventory Tool ║"
echo " ╚══════════════════════════════════════════╝"
echo ""
echo " [1] Interface graphique (port 8081)"
echo " [2] Ligne de commande (rapport TXT/JSON)"
echo " [3] Shell uniquement"
echo " [4] Quitter"
echo ""
read -rp " Votre choix [1-4] : " lsit_choix
case "$lsit_choix" in
1)
echo ""
echo " Démarrage du tableau de bord..."
echo " --> Ouvre http://localhost:8081 dans ton navigateur."
echo ' Tapez "exit" ou "end" pour arrêter et revenir ici.'
echo ""
python3 /vagrant/lsit.py --serve
;;
2)
echo ""
lsit
;;
3)
echo ""
echo " Commandes disponibles :"
echo " lsit --> rapport TXT"
echo " lsit --format json --> rapport JSON"
echo " lsit --serve --> tableau de bord web (port 8081)"
echo ""
break
;;
4|exit|end)
echo ""
exit
;;
*)
echo " Choix invalide. Veuillez entrer 1, 2, 3 ou 4."
;;
esac
done
EOF
chmod +x /etc/profile.d/lsit-welcome.sh
SHELL
end