2023-01-08 20:59:14 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Where are we?
|
|
|
|
pwd=$(pwd)
|
|
|
|
|
|
|
|
# Find out what the src and dest are...
|
|
|
|
echo "Please enter your source path"
|
|
|
|
read -r src
|
|
|
|
echo "Please enter your destination path"
|
|
|
|
read -r dest
|
2023-01-08 21:09:24 +01:00
|
|
|
|
|
|
|
# Check for the 'bin' dir in the users 'Home' directory and create it if not present...
|
|
|
|
if [ -d "$HOME"/bin ];
|
|
|
|
then echo "$HOME/bin exists, nothing to do..."
|
2023-01-18 20:17:53 +01:00
|
|
|
else echo "$HOME/bin not found - creating..." && mkdir "$HOME"/bin && echo "$HOME/bin created!"
|
2023-01-08 21:09:24 +01:00
|
|
|
fi
|
|
|
|
|
2023-01-08 21:45:10 +01:00
|
|
|
# Make the root dir...
|
2023-01-08 21:30:15 +01:00
|
|
|
mkdir "$HOME"/bin/backup_home
|
|
|
|
|
2023-01-08 21:09:24 +01:00
|
|
|
# Copy files over to ~/bin
|
2023-01-08 21:26:38 +01:00
|
|
|
cp "$pwd"/Backup.sh "$HOME"/bin/backup_home
|
|
|
|
cp "$pwd"/Backup.svg "$HOME"/bin/backup_home
|
|
|
|
cp "$pwd"/LICENSE "$HOME"/bin/backup_home
|
|
|
|
cp "$pwd"/README.md "$HOME"/bin/backup_home
|
2023-01-08 22:01:51 +01:00
|
|
|
cp "$pwd"/uninstall.sh "$HOME"/bin/backup_home
|
2023-01-08 21:45:10 +01:00
|
|
|
cp "$pwd"/Backup.desktop "$HOME"/.local/share/applications
|
2023-01-08 21:09:24 +01:00
|
|
|
|
2023-03-18 15:11:13 +01:00
|
|
|
# Set source and destination in Backup.sh
|
2023-01-09 17:56:53 +01:00
|
|
|
sed -i "s|source=|source=$src|" "$HOME"/bin/backup_home/Backup.sh
|
|
|
|
sed -i "s|destination=|destination=$dest|" "$HOME"/bin/backup_home/Backup.sh
|
|
|
|
|
|
|
|
|
2023-01-09 15:53:51 +01:00
|
|
|
# Edit the menu entry file...
|
2023-01-09 17:59:50 +01:00
|
|
|
sed -i "s|Exec=|Exec=$HOME/bin/backup_home/Backup.sh|" "$HOME"/.local/share/applications/Backup.desktop
|
2023-01-09 17:45:34 +01:00
|
|
|
sed -i "s|Icon=|Icon=$HOME/bin/backup_home/Backup.svg|" "$HOME"/.local/share/applications/Backup.desktop
|
2023-01-09 15:53:51 +01:00
|
|
|
|
2023-01-08 21:45:10 +01:00
|
|
|
# Let the user know we have finished...
|
2023-01-08 21:09:24 +01:00
|
|
|
echo "All done! Press 'Enter' to close this window..."
|
|
|
|
read -r
|