From 77d0b75af9b1f03cc6dcfad04e270c4865982ecc Mon Sep 17 00:00:00 2001 From: q3aql Date: Sun, 10 Aug 2025 20:22:46 +0200 Subject: [PATCH] scripts --- scripts/update-electronmail.sh | 14 ++++++++++++++ scripts/update-ffmpeg.sh | 9 +++++++++ scripts/update-firefox.sh | 9 +++++++++ scripts/update-open-tv.sh | 14 ++++++++++++++ scripts/update-rclone.sh | 14 ++++++++++++++ scripts/update-telegram.sh | 9 +++++++++ scripts/update-vim.sh | 9 +++++++++ scripts/update-yazi.sh | 9 +++++++++ scripts/update-yt-dlp.sh | 9 +++++++++ 9 files changed, 96 insertions(+) diff --git a/scripts/update-electronmail.sh b/scripts/update-electronmail.sh index 49b82e7..133e373 100755 --- a/scripts/update-electronmail.sh +++ b/scripts/update-electronmail.sh @@ -1,5 +1,19 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + +if [ ! -f /usr/bin/apt ] ; then + echo "This script is only for Debian-based systems" + exit +fi + echo "Checking electronmail version" touch /etc/electronmail_version.conf version_electronmail=$(curl "https://github.com/vladimiry/ElectronMail/releases" 2> /dev/null | grep "releases/tag" | head -1 | cut -d "=" -f 4 | cut -d "/" -f 6 | cut -d '"' -f 1 | cut -d "v" -f 2) diff --git a/scripts/update-ffmpeg.sh b/scripts/update-ffmpeg.sh index 88a6b69..90e27f9 100755 --- a/scripts/update-ffmpeg.sh +++ b/scripts/update-ffmpeg.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + install_ffmpeg_gen(){ echo "Downloading ffmpeg" rm -rf /tmp/ffmpeg.tar.xz diff --git a/scripts/update-firefox.sh b/scripts/update-firefox.sh index 8300af6..e2acaa6 100755 --- a/scripts/update-firefox.sh +++ b/scripts/update-firefox.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + install_firefox_gen() { download_url_firefox="${1}" echo "Downloading firefox" diff --git a/scripts/update-open-tv.sh b/scripts/update-open-tv.sh index 0edefcc..cc00ad8 100755 --- a/scripts/update-open-tv.sh +++ b/scripts/update-open-tv.sh @@ -1,5 +1,19 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + +if [ ! -f /usr/bin/apt ] ; then + echo "This script is only for Debian-based systems" + exit +fi + echo "Checking open-tv version" touch /etc/opentv_version.conf version_opentv=$(curl "https://github.com/Fredolx/open-tv/releases" 2> /dev/null | grep "releases/tag" | head -1 | cut -d "=" -f 4 | cut -d "/" -f 6 | cut -d '"' -f 1 | cut -d "v" -f 2) diff --git a/scripts/update-rclone.sh b/scripts/update-rclone.sh index 309c579..a4a8535 100755 --- a/scripts/update-rclone.sh +++ b/scripts/update-rclone.sh @@ -1,5 +1,19 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + +if [ ! -f /usr/bin/apt ] ; then + echo "This script is only for Debian-based systems" + exit +fi + echo "Checking rclone version" touch /etc/rclone_version.conf version_rclone=$(curl "https://rclone.org/downloads/" 2> /dev/null | grep "\"release\"" | cut -d ">" -f 2 | cut -d "<" -f 1) diff --git a/scripts/update-telegram.sh b/scripts/update-telegram.sh index 996354d..afcb2f4 100755 --- a/scripts/update-telegram.sh +++ b/scripts/update-telegram.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + install_telegram_gen() { download_url_telegram="${1}" echo "Downloading telegram" diff --git a/scripts/update-vim.sh b/scripts/update-vim.sh index 3e8b7c4..42978e6 100755 --- a/scripts/update-vim.sh +++ b/scripts/update-vim.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + install_vim_gen(){ version_download="${1}" echo "Downloading vim" diff --git a/scripts/update-yazi.sh b/scripts/update-yazi.sh index 1a3b7e7..aa30d48 100755 --- a/scripts/update-yazi.sh +++ b/scripts/update-yazi.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + install_yazi_gen(){ version_download="${1}" echo "Downloading yazi" diff --git a/scripts/update-yt-dlp.sh b/scripts/update-yt-dlp.sh index 53ae186..8730a82 100755 --- a/scripts/update-yt-dlp.sh +++ b/scripts/update-yt-dlp.sh @@ -1,5 +1,14 @@ #!/bin/bash +mkdir -p /etc/root 2> /dev/null +rootperm=$? +if [ $rootperm -eq 0 ] ; then + rm -rf /etc/root +else + echo "Root permission is required to run this script" + exit +fi + echo "Checking yt-dlp version" touch /etc/ytdlp_version.conf version_ytdlp=$(curl "https://github.com/yt-dlp/yt-dlp/releases" 2> /dev/null | grep "releases/tag" | head -1 | cut -d "=" -f 4 | cut -d "/" -f 6 | cut -d '"' -f 1 | cut -d "v" -f 2)