Imported usable scripts from the private temporary repository

This commit is contained in:
Michele Cereda
2021-10-16 23:39:07 +02:00
parent c086c1ab27
commit 2a1357055c
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env sh
: ${DEVICE:?not set}
: ${LABEL:?not set}
: ${MOUNT_OPTIONS:-compress-force=zstd}
[[ ${EUID} -eq 0 ]] || (echo "Please rerun this script with root privileges" && exit 1)
[[ -f "${DEVICE}" ]] || echo "${DEVICE} not found"
cryptsetup luksFormat "${DEVICE}"
cryptsetup luksOpen "${DEVICE}" "${LABEL}"
mkfs.btrfs --label "${LABEL}" "/dev/mapper/${LABEL}"
mount --types btrfs --options "${MOUNT_OPTIONS}" "/dev/mapper/${LABEL}" "/mnt/${LABEL}"
umount "/mnt/${LABEL}"
cryptsetup luksClose "${DEVICE}"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env sh
DROPBOX_ACCOUNTS="${DROPBOX_ACCOUNTS:-private work}"
for ACCOUNT in $DROPBOX_ACCOUNTS
do
HOME="${HOME}/.dropbox-${ACCOUNT}" dropbox start &
done

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env sh
function dropbox-install {
export DROPBOX_archive="dropbox_daemon.tar.gz"
export DROPBOX_retries="3"
export DROPBOX_url="http://www.getdropbox.com/download?plat=lnx.x86_64"
# download daemon
echo " downloading archive…"
curl -C - -o $DROPBOX_archive --retry $DROPBOX_retries -S -L $DROPBOX_url
# install daemon
echo " unarchiving tarball…"
tar zxf $DROPBOX_archive -C $HOME
# cleaning
rm $DROPBOX_archive
}
if [ ! -f start-multiple-instances.sh ]
then
echo "[ERROR] Dropbox multi-instances start script not usable. Aborrting."
exit 1
fi
if [ ! -d ${HOME}/.dropbox-dist ]
then
echo "[WARNING] Default Dropbox dist directory not found."
echo "[WARNING] Downloading and installing in the default directory."
else
rm -r ${HOME}/.dropbox-dist
fi
echo "[NOTICE] Stopping all processes using the current version of Dropbox."
killall -I dropbox
dropbox-install
echo "[NOTICE] Faccio ripartire il processo per ogni account"
./start-multiple-instances.sh

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env sh
flatpak remote-add \
--user --if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --or-update --user \
--noninteractive --assumeyes \
flathub com.bitwarden