Compare commits
7 Commits
ec5a09da64
...
d84d9e6933
Author | SHA1 | Date | |
---|---|---|---|
d84d9e6933 | |||
12e5c3e2b1 | |||
49335145fd | |||
0aeb3b770f | |||
aaf96cd5c7 | |||
976100ec25 | |||
571e03680f |
@ -1,7 +0,0 @@
|
||||
cd /var/tmp/
|
||||
git clone https://aur.archlinux.org/ffmpeg-libfdk_aac.git
|
||||
cd ffmpeg-libfdk_aac/
|
||||
makepkg -csr
|
||||
pacman -Ud
|
||||
cd ..
|
||||
rm -r ffmpeg-libfdk_aac/
|
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# this script is supposed to apply changes in /sync/{home,root}_external to /sync/{home,root}_external and thus to / resp. ~/
|
||||
# FIXME!!! WIP
|
||||
# FIXME!!! syncing root stuff not yet implemented
|
||||
# FIXME!!! user name/ group name/ home dir hard coded for now...
|
||||
|
||||
externalDir=/sync/home_external/
|
||||
internalDir=/sync/home_internal/
|
||||
userHome=/home/fabian/
|
||||
user=fabian
|
||||
group=fabian
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Error. No file(s) for import given"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file="$(find $internalDir -name $1)"
|
||||
|
||||
# if a file is merely changed, copy its content into the existing target directory
|
||||
if [[ -e "$file" ]]; then
|
||||
echo "copying file content of $1 to $file"
|
||||
cat $1 > $file
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# if a new file/ dir is created, copy it into the $internalDir retaining the relative path
|
||||
# after that, copy/ hard link it to the $userHome directory and assign the correct user/ group
|
||||
# NOTE: one could solve that by having the same user + group on every system
|
||||
relPath="$(realpath --relative-to=$externalDir $1)" # should also contain the leaf name
|
||||
echo "new file/dir. relative path: $relPath"
|
||||
if [[ -f "$1" ]]; then
|
||||
install -Dv $1 "$internalDir$relPath"
|
||||
else
|
||||
mkdir -pv "$internalDir$relPath"
|
||||
fi
|
||||
cp -lrv "$internalDir$relPath" $userHome
|
||||
chown -v "$user:$group" "$userHome$relPath"
|
||||
exit 0
|
0
scripts/mount_general.sh
Executable file → Normal file
0
scripts/mount_general.sh
Executable file → Normal file
@ -6,9 +6,9 @@ map=
|
||||
vbr=
|
||||
while [[ $# > 0 ]]; do
|
||||
case $1 in
|
||||
-map) map='-map 0:0'; shift;;
|
||||
-vbr) vbr='libfdk_aac -profile:a aac_he -b:a 64k'; shift;;
|
||||
* ) break ;; # Anything else stops command line processing.
|
||||
-map) map='-map 0:0'; shift;;
|
||||
-vbr) vbr='aac_at -profile:a aac_he -b:a 64k'; shift;;
|
||||
* ) break ;; # Anything else stops command line processing.
|
||||
esac
|
||||
done
|
||||
|
||||
|
@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
shopt -s expand_aliases
|
||||
source /sync/home_internal/.bash_aliases # FSCLEANUP -> zum besseren testen
|
||||
# source /sync/home_external/.bash_aliases
|
||||
|
||||
|
||||
sync () {
|
||||
dry_run=false
|
||||
home_or_root=
|
||||
update=true
|
||||
in_to_ex=
|
||||
while [[ $# > 0 ]]; do
|
||||
case $1 in
|
||||
-d | --dry ) dry_run=true; shift;;
|
||||
-c | --checksum ) update=false; shift;;
|
||||
--in-to-ex ) in_to_ex=true; shift;;
|
||||
--ex-to-in ) in_to_ex=false; shift;;
|
||||
--dir ) home_or_root=$2; shift 2;;
|
||||
* ) break ;; # Anything else stops command line processing.
|
||||
esac
|
||||
done
|
||||
|
||||
dir_external=/sync/${home_or_root}_external/
|
||||
dir_internal=/sync/${home_or_root}_internal/
|
||||
# dry-run
|
||||
if [[ "$dry_run" == true ]]; then
|
||||
ex_to_in=
|
||||
in_to_ex=
|
||||
update_or_default=
|
||||
if [[ "$update" == true ]]; then
|
||||
update_or_default='UPDATE'
|
||||
ex_to_in=$(rsync_update $dir_external $dir_internal --dry-run)
|
||||
in_to_ex=$(rsync_update $dir_internal $dir_external --dry-run)
|
||||
else
|
||||
update_or_default='DEFAULT'
|
||||
ex_to_in=$(rsync_default $dir_external $dir_internal --dry-run)
|
||||
in_to_ex=$(rsync_default $dir_internal $dir_external --dry-run)
|
||||
fi
|
||||
# use printf for displaying \n as newline correctly
|
||||
printf "RSYNC ${update_or_default}: external -> internal:\n\n$ex_to_in\n\nRSYNC ${update_or_default}: internal -> external:\n\n$in_to_ex\n"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
# real deal
|
||||
if [[ -z "$in_to_ex" ]]; then
|
||||
echo "Error. No sync direction given."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [[ "$update" == true ]]; then
|
||||
if [[ "$in_to_ex" == true ]]; then
|
||||
rsync_update $dir_internal $dir_external
|
||||
else
|
||||
rsync_update $dir_external $dir_internal
|
||||
fi
|
||||
exit 0;
|
||||
fi
|
||||
if [[ "$in_to_ex" == true ]]; then
|
||||
rsync_default $dir_internal $dir_external
|
||||
else
|
||||
rsync_default $dir_external $dir_internal
|
||||
fi
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source /sync/scripts/sync_general.sh
|
||||
|
||||
sync --dir home $@
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source /sync/scripts/sync_general.sh
|
||||
|
||||
sync --dir root $@
|
Loading…
Reference in New Issue
Block a user