Compare commits

...

7 Commits

Author SHA1 Message Date
73f5fe2e45 fixed commandExists 2025-11-20 21:28:53 +01:00
96ced8ff18 script for editing audible audio books post decrypt 2025-11-19 21:02:35 +01:00
edf7f1a1d1 - improved map, vbr flags 2025-11-19 21:02:03 +01:00
57644311b3 pass down arguments 2025-11-19 21:00:59 +01:00
85bae25c2f added escape replacement 2025-11-19 21:00:35 +01:00
a120d54b30 updated backup scripts 2025-11-19 20:59:53 +01:00
916faa68fd dont quit the tty upon failure 2025-11-19 20:59:08 +01:00
10 changed files with 29 additions and 14 deletions

View File

@@ -41,7 +41,7 @@ alias start_x11_vnc="x11vnc -many -display :0 -no6 -rfbport 5900 -auth /var/run/
commandExists() { commandExists() {
type $1 2 >& 1 > /dev/null type $1 2>&1 > /dev/null
} }
@@ -68,7 +68,7 @@ doUpdateSystem() {
updateFlatpak() { updateFlatpak() {
if [[ ! $(commandExists flatpak) ]]; then if ! $(commandExists flatpak); then
return 1; return 1;
fi fi
noconfirm= noconfirm=
@@ -127,7 +127,7 @@ finds () {
# sends a desktop-notification with an icon signalling an error # sends a desktop-notification with an icon signalling an error
notifyError () { notifyError () {
if [[ ! $(commandExists notify-send) ]]; then if ! $(commandExists notify-send); then
echo "ERROR: $1"; echo "ERROR: $1";
else else
notify-send "$1" --icon=data-warning; notify-send "$1" --icon=data-warning;
@@ -137,7 +137,7 @@ notifyError () {
# sends a desktop-notification with an icon signalling a simple information # sends a desktop-notification with an icon signalling a simple information
notifyInfo () { notifyInfo () {
if [[ ! $(commandExists notify-send) ]]; then if ! $(commandExists notify-send); then
echo "INFO: $1"; echo "INFO: $1";
else else
notify-send "$1" --icon=preferences-desktop-notification; notify-send "$1" --icon=preferences-desktop-notification;

View File

@@ -2,7 +2,7 @@
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples # for examples
set -o pipefail # set -o pipefail
# set -u # set -u
# If not running interactively, don't do anything # If not running interactively, don't do anything

View File

@@ -32,10 +32,10 @@ backupRootDirectory /etc/docker/daemon.json $BACKUP_DIR_ROOT/docker/
### upload backup ### ### upload backup ###
##################### #####################
if [[ "$1" == "--noupload" ]]; then if [[ $# > 0 && "$1" == "--noupload" ]]; then
exit 0; exit 0;
fi fi
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" --filter="P /home/docker" /sync/backup/ fabian@garrus:/citadel/backup/edi/ sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /sync/backup/ fabian@garrus:/citadel/backup/edi/
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/ sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/
echo "Note: remember to keep /citadel in sync!" echo "Note: remember to keep /citadel in sync!"

View File

@@ -20,7 +20,7 @@ backupDirectory $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/
### upload backup ### ### upload backup ###
##################### #####################
if [[ "$1" == "--noupload" ]]; then if [[ $# > 0 && "$1" == "--noupload" ]]; then
exit 0; exit 0;
fi fi

View File

@@ -4,4 +4,4 @@ set -euo pipefail
source /sync/scripts/dockerContainerAction.sh source /sync/scripts/dockerContainerAction.sh
# FIXME!!! implement possibility to pass down directory # FIXME!!! implement possibility to pass down directory
upDownContainers down upDownContainers down $@

View File

@@ -13,6 +13,7 @@ replacements['(']='_';
replacements[')']='_'; replacements[')']='_';
replacements['[']='_'; replacements['[']='_';
replacements[']']='_'; replacements[']']='_';
replacements[',']='_';
while [[ $# > 0 ]]; do while [[ $# > 0 ]]; do
replacements["$1"]="$2"; replacements["$1"]="$2";
shift 2; shift 2;

14
scripts/postTreatmentAudible.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
/sync/scripts/escapeFilenames.sh . _
for d in *; do
cd "$d";
/sync/scripts/escapeFilenames.sh Chapter Kapitel
/sync/scripts/reencode_m4a.sh -map;
rm *.m4a;
mv * "../${d}_reencode";
cd ..;
rmdir "$d"
mv "${d}_reencode" "$d";
done

View File

@@ -4,4 +4,4 @@ set -euo pipefail
source /sync/scripts/dockerContainerAction.sh source /sync/scripts/dockerContainerAction.sh
# FIXME!!! implement possibility to pass down directory # FIXME!!! implement possibility to pass down directory
upDownContainers pull upDownContainers pull $@

View File

@@ -6,15 +6,15 @@ map=
vbr= vbr=
while [[ $# > 0 ]]; do while [[ $# > 0 ]]; do
case $1 in case $1 in
-map) map='-map 0:0'; shift;; -map) map='-map 0:a'; shift;;
-vbr) vbr='aac_at -profile:a aac_he -b:a 64k'; shift;; -vbr) vbr='aac -profile:a aac_he -b:a 64k'; shift;;
* ) break ;; # Anything else stops command line processing. * ) break ;; # Anything else stops command line processing.
esac esac
done done
# if no variable bitrate, just copy audio # if no variable bitrate, just copy audio
if [[ -z $vbr ]]; then if [[ -z $vbr ]]; then
map="$map copy" vbr="copy"
fi fi
# ensure existence of destination folder # ensure existence of destination folder

View File

@@ -4,4 +4,4 @@ set -euo pipefail
source /sync/scripts/dockerContainerAction.sh source /sync/scripts/dockerContainerAction.sh
# FIXME!!! implement possibility to pass down directory # FIXME!!! implement possibility to pass down directory
upDownContainers up -d upDownContainers up -d $@