1
0

Nouveau script

This commit is contained in:
pulsar89.5 2021-02-09 11:07:56 +01:00
parent fe8ec6d6fe
commit 02ffe86a51

58
update_opt_app.bash Executable file
View File

@ -0,0 +1,58 @@
#!/bin/bash
# Entrer dans le dossier /opt
cd /opt
## KeepassXC
# Nom de l'application
app="keepassxc"
# Télécharger
url="https://api.github.com/repos/keepassxreboot/keepassxc/releases/latest"
latest=$(curl -s $url | grep browser_download_url | awk -F '[""]' '{print $4}' | grep "$(uname -m)" | grep -e ".AppImage$")
sudo curl --location --output $app.AppImage $latest
# Appliquer les droits
sudo chown root:sudo $app.AppImage && \
sudo chmod g+x $app.AppImage
# Créer le lanceur
if [[ ! -f "/usr/share/applications/${app}.desktop" ]]; then
sudo tee /usr/share/applications/${app}.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Icon=${app}
Exec=/opt/${app}.AppImage
Name=KeePassXC
Comment=Définition personnalisée pour KeePassXC
EOF
fi
## Draw.io
# Nom de l'application
app="drawio"
# Télécharger
url="https://api.github.com/repos/jgraph/drawio-desktop/releases/latest"
latest=$(curl -s $url | grep browser_download_url | awk -F '[""]' '{print $4}' | grep "$(uname -m)" | grep -e ".AppImage$")
sudo curl --location --output $app.AppImage $latest
# Appliquer les droits
sudo chown root:sudo $app.AppImage && \
sudo chmod g+x $app.AppImage
# Créer le lanceur
if [[ ! -f "/usr/share/applications/${app}.desktop" ]]; then
sudo tee /usr/share/applications/${app}.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Icon=${app}
Exec=/opt/$app.AppImage
Name=Draw.io
Comment=Définition personnalisée pour Draw.io
EOF
fi