Nouveau script
This commit is contained in:
parent
fe8ec6d6fe
commit
02ffe86a51
58
update_opt_app.bash
Executable file
58
update_opt_app.bash
Executable 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
|
Loading…
Reference in New Issue
Block a user