-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
74 lines (69 loc) · 2.52 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# mntftp - Simple FTP Mount tool for Linux
# Copyright (C) 2020 Dovi Cowan - dovi@fullynetworking.co.uk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
echo "mntftp - Simple FTP Mount tool for Linux"
echo
echo "Copyright (C) 2020 Dovi Cowan - dovi@fullynetworking.co.uk"
echo "This program comes with ABSOLUTELY NO WARRANTY; for details see the GNU GPL v3.0."
echo "This is free software, and you are welcome to redistribute it"
echo "under certain conditions; see the GNU GPL v3.0."
echo
echo "FTP MOUNTER v1"
echo
echo "Installation"
echo
echo "Stage 1: Installing curlftpfs"
sudo apt install -y curlftpfs
echo "Stage 2: Setting up your system"
echo -n "Creating mnt folder... "
mkdir ~/mnt
echo "done"
echo -n "Checking if mount.sh is in same directory... "
INSTALL_DIR=""
if test -f "mount.sh"; then
echo "yes"
INSTALL_DIR=$(pwd)
echo -n "Making mount.sh executable... "
chmod +x mount.sh
echo "done"
else
echo "no"
if [[ -d ~/.local/share ]]
then
echo -n "Creating folder ~/.local/share/mntftp... "
mkdir ~/.local/share/mntftp
INSTALL_DIR="$HOME/.local/share/mntftp"
echo "done"
else
echo -n "Creating folder ~/mntftp... "
INSTALL_DIR="$HOME/mntftp"
mkdir ~/mntftp
echo "done"
fi
echo -n "Downloading mount.sh... "
sudo curl -s https://raw.githubusercontent.com/dcowan-london/mntftp/master/mount.sh --output $INSTALL_DIR/mount.sh
echo "done"
echo -n "Making mount.sh executable... "
sudo chmod +x $INSTALL_DIR/mount.sh
echo "done"
fi
echo -n "Adding .bashrc alias... "
echo "alias mntftp=\"$INSTALL_DIR/mount.sh\"" >> ~/.bashrc
echo "done"
echo -n "Creating mount.txt... "
sudo curl -s https://raw.githubusercontent.com/dcowan-london/mntftp/master/mount.txt --output $INSTALL_DIR/mount.txt
echo "done"
echo -n "Removing install script... "
rm install.sh
echo "done"
echo -e "\e[1mDone installing mntftp. Run \"mntftp help\" to get started.\e[0m"