Added new fr24feed-dump1090 function

This commit is contained in:
2025-05-14 08:26:44 +01:00
parent 27bcc2a689
commit d10f0018d1
4 changed files with 81 additions and 5 deletions
+42 -4
View File
@@ -4,9 +4,47 @@
# Find all dot files then if the original file exists, create a backup
# Once backed up to {file}.dtbak symlink the new dotfile in place
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
if [ -e ~/$file ]; then
mv -f ~/$file{,.dtbak}
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n"); do
# Check if it's a file and if a symlink already exists
target_file="~/$file"
if [ -e $target_file ]; then
if [ -L $target_file ]; then
# If it's a symlink and points to the correct location, skip it
target_link=$(readlink $target_file)
if [ "$target_link" != "$PWD/$file" ]; then
mv -f $target_file{,.dtbak} # Backup existing symlink or file
fi
else
mv -f $target_file{,.dtbak} # Backup if it's not a symlink
fi
fi
ln -s $PWD/$file ~/$file
ln -s $PWD/$file $target_file
done
# Handle directories
for dir in $(find . -maxdepth 1 -name ".*" -type d); do
target_dir="~/$dir"
# Create the directory in the target location if it doesn't exist
if [ ! -d $target_dir ]; then
mkdir -p $target_dir
fi
# Now handle symlinks for files inside the directory
for subfile in $(find $dir -type f); do
relative_subfile="${subfile#$dir/}"
target_subfile="$target_dir/$relative_subfile"
# Check if the symlink already exists and points to the correct location
if [ ! -e $target_subfile ]; then
ln -s $PWD/$subfile $target_subfile
elif [ -L $target_subfile ]; then
target_link=$(readlink $target_subfile)
if [ "$target_link" != "$PWD/$subfile" ]; then
mv -f $target_subfile{,.dtbak} # Backup existing symlink
ln -s $PWD/$subfile $target_subfile # Create new symlink
fi
fi
done
done