-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·84 lines (67 loc) · 2.07 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
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# Define the variables
CTEMP=/tmp
CGLOBS=$CTEMP/globs
URL="https://raw.githubusercontent.com/Pseudonymous-coders/CRI/master"
URLR="https://raw.githubusercontent.com/Pseudonymous-coders/CRI-resources/master"
CONFIGS="$URLR/configs"
GLOBS="$CONFIGS/globs"
# Pull the latest globs functions
sudo mkdir -p $CGLOBS
cd $CGLOBS
sudo curl -Ls "$GLOBS/globvar" -o $CGLOBS/globvar
sudo curl -Ls "$GLOBS/globfun" -o $CGLOBS/globfun
sudo curl -Ls "$CONFIGS/install_list.txt" -o $CTEMP/install_list.txt
sudo chmod 755 $CGLOBS/globvar $CGLOBS/globfun
# Clear the screen and begin the download
clear
source globvar
source globfun
echo "Welcome to the CRI installer!
Created By: $AUTHORS
Version: $VERSION
Url: $URL
System:
User: $USER
Arch: $ARCH
"
sleep 1
if [[ $ARCH != "i686" ]] && [[ $ARCH != "x86_64" ]]; then # Check if chromebook is compatible
printf "Your device doesn't support CRI yet! :(\nExiting..."
sleep 0.5
exit 1
fi
printf "This installation will require internet conection\n\n"
if ask "Are you comfortable waiting a little bit"; then
echo "Continuing..."
else
echo "Exiting..."
exit 1
fi
echo "Creating working directories..."
sudo mkdir -p $CTEMP $CPKG $CBUILD
sudo chown $USER:$USER $CTEMP $CPKG $CBUILD
PKGURL=$CONFIGS/libs
cd $CTEMP
printf "\nDownloading core files\n\n..."
sudo chmod 755 install_list.txt #Makes the commands file have every permisson so that anyone can use it
NAMES="$(< install_list.txt)" #names from names.txt file
LINES=$(lineCount)
NUMBERS=1
cd $CPKG
for NAME in $NAMES; do #Downloads all nessisary files from github to /usr/local/bin
clear
printf "Welcome to the CRI installer\nCreated By: $AUTHORS\nVersion: $VERSION\nFile $NUMBERS/$LINES...\n\n ${NAME##*/} \n"
let "NUMBERS += 1"
sudo curl -Ls "$PKGURL/$NAME" -o $CPKG/${NAME##*/}
sudo chmod 755 *
sudo chown $USER:$USER ${NAME##*/}
sudo bash ${NAME##*/} # Run setup in seperate thread
fixowner 2&>/dev/null
done
wait # Wait for threads to update
clear
echo "Cleaning up everything..."
sudo rm -rf $CPKG
sudo rm -rf $CBUILD
echo "Thank you for installing CRI!"