-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_to_bin.sh
40 lines (39 loc) · 1.35 KB
/
install_to_bin.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
#!/bin/bash
echo "[i] We will now install Luna to your bin path..."
if [ -d "/usr/share/Luna" ] ; then
echo "[i] Found an old version of Luna, proceeding to update..."
echo "[i] Backing up old verison."
if [ -d "/usr/share/Luna/Backup" ] ; then
sudo mv /usr/share/Luna/Backup ./Backup
else
mkdir ./Backup
fi
name="./Backup/Luna"
if [ -d $name ] ; then
i=0
while [ -d "$name.bak$i" ] ; do
let i++
done
name="$name.bak$i"
fi
sudo mv /usr/share/Luna $name
mv ./Backup ./Luna/
sudo cp -ar ./Luna /usr/share/
echo "[i] Installation sucessful."
echo "[i] Making Luna executable..."
sudo mv /usr/share/Luna/main.py /usr/share/Luna/luna
sudo chmod +x /usr/share/Luna/luna
sudo ln -s /usr/share/Luna/luna /usr/bin/luna || echo "[i] Link already seems to exist."
else
sudo cp -ar ./Luna /usr/share/
echo "[i] Installation sucessful."
echo "[i] Making Luna executable..."
sudo mv /usr/share/Luna/main.py /usr/share/Luna/luna
sudo chmod +x /usr/share/Luna/luna
sudo ln -s /usr/share/Luna/luna /usr/bin/luna || echo "[i] Link already seems to exist."
fi
echo "[i] You can delete the Luna folder now."
echo "----------------------------------------"
echo "[i] Run 'sudo luna' to start Luna."
echo "----------------------------------------"
exit 0