Correction : utilisation de la commande whoami pour éviter les problèmes liés à la variable d'environnement USER

This commit is contained in:
Hippolyte Chauvin 2023-07-28 10:29:21 +02:00
parent e130dfe569
commit a11dc08fb9
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
#!/bin/sh
[ "$USER" != root ] && exec sudo "$0" "$@"
[ "$(whoami)" != root ] && exec sudo "$0" "$@"
apt-get update
apt-get upgrade
apt-get autoremove

View file

@ -1,4 +1,4 @@
#!/bin/sh
[ "$USER" != root ] && exec "$0" "$@"
[ "$(whoami)" != root ] && exec "$0" "$@"
docker images --format '{{.Repository}}' | xargs -L 1 docker pull