User Scripts
Posted: 05 Mar 2025, 10:04
There is now a subforum in Porteus eXchange Telegram group devoted to publishing useful user-contributed scripts:
https://t.me/PorteusX/98
https://t.me/PorteusX/98
Of course, they are all here first: scattered around the topics in this forum, it's just an attempt to gather some of them one in place in Telegram group as well. As an incomplete back-up. This forum feels fragile at times: it's often under attack and difficult to post into.
Code: Select all
#!/usr/bin/bash
# Updates a portable installation of VSCode.
# When VSCode notifies of a new version,
# run this script instead which starts by changing to your portable directory, e.g,:
cd /I
# and downloads the latest .tar.gz from
wget -Nq --show-progress --content-disposition "https://code.visualstudio.com/sha/download?build=stable&os=linux-x64"
tar -xf code-*.tar.gz
mv VSCode VSCodeOLD
mv VSCode-* VSCode
mv VSCodeOLD/data VSCode/
chown -hR root:root VSCode
chmod 4755 VSCode/chrome-sandbox
echo "$(tput setaf 2) " #green, a new line
echo "These can now be deleted:"
ls code-*.tar.gz -d VSCodeOLD
echo "$(tput bold) " #bold, a new line
read -t 10 -n 1 -r -p "Delete them now? [y/N] " response
if [[ $response == [yY] ]]; then
rm code-*.tar.gz -r VSCodeOLD
fi
echo "$(tput sgr0)"