-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·35 lines (28 loc) · 1.06 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
tmpInstallDir="/tmp/bcktousbsrc"
repoLocation="https://raw.githubusercontent.com/teito-dev/bcktousb/releases"
shareDir="$HOME/.local/share/bcktousb"
binDir="$HOME/.local/bin"
bcktousbBin="$binDir/bcktousb"
echo "Downloading all necessary install files"
# creating temp dir to store all the necessary install files and cd into it during install
if [ ! -d $tmpInstallDir ];then
mkdir $tmpInstallDir
fi
cd $tmpInstallDir
echo "$repoLocation/bcktousb"
curl -O "$repoLocation/bcktousb" # download the commandline script
curl -O "$repoLocation/share/bcktousb_config" # download the default config file
# Start installing
echo -e "\n\n"
echo -e "All files downloaded, Starting Installation Now \n"
# Install main script
cp $tmpInstallDir/bcktousb $bcktousbBin
chmod +x $bcktousbBin # make it executable
# Init the shareDir with all necessary content
mkdir $shareDir
cp "$tmpInstallDir/bcktousb_config" "$shareDir/bcktousb_config"
# cleaning up after installation
echo "Cleaning up post install"
rm -r $tmpInstallDir
echo "Installation complete: Have a great day!"