-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
169 lines (151 loc) · 5.92 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/bash
# Layer: Soil
#. /usr/lib/floflis/./config
. "$FLOPREFIX"usr/lib/floflis/./config #expecting $FLOPREFIX has been successfuly imported from DNA's installer
#export FLOPREFIX
#fi
#export flofmach && export flofdistro && export flofarch && export osfullname && export osname && export osversion && export osbuild && export osbuildcodename && export updatepatch && export year && export layer && export nxtlayer && export distrobase && export user && export specialbuildattempt
# <---- load definitions & settings
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# would detect fakeroot
#for path in ${LD_LIBRARY_PATH//:/ }; do
# if [[ "$path" == *libfakeroot ]]
# then
# echo "You're using fakeroot. Floflis won't work."
# exit
#fi
#done
is_root=false
if [ "$([[ $UID -eq 0 ]] || echo "Not root")" = "Not root" ]
then
is_root=false
else
is_root=true
fi
maysudo=""
if [ "$is_root" = "false" ]
then
maysudo="sudo"
else
maysudo=""
fi
if [ -e "$FLOPREFIX"tmp/cubicmode ]; then maysudo="";fi
if [[ "$flofmach" == "Termux" ]]; then maysudo="";fi
cat << "EOF"
-. .-. .-. .-. .-. .-. .
\ \ / \ \ / \ \ /
/ \ \ / \ \ / \ \
~ `-~ `-` `-~ `-` `-~ `-
_ _
|_ | _ _|_ | o _
| | (_) | | | _>
___ _ _ _
|_ _| _ _ ___ | |_ __ _ | | | | ___ _ _
| | | ' \ (_-< | _| / _` | | | | | / -_) | '_|
|___| |_||_| /__/ \__| \__,_| |_| |_| \___| |_|
for Floflis Soil
EOF
echo "- Detecting if Floflis Core is installed..."
if [ -e /usr/lib/floflis/layers/core ]
then
echo "- Installing Floflis Soil as init program..."
$maysudo echo "$(cat /usr/lib/floflis/layers/soil/flo-init)" >> /etc/init.d/flo-init && $maysudo rm -f /usr/lib/floflis/layers/soil/flo-init
$maysudo chmod 755 /etc/init.d/flo-init && $maysudo update-rc.d flo-init defaults
if [[ "$flofmach" == "Termux" ]]; then
echo "Installing Starship prompt..."
curl -sS https://starship.rs/install.sh |sh -s -- --bin-dir /data/data/com.termux/files/usr/bin
fi
echo "- Installing programs..."
if [ -e /usr/local/bin/*antiX* ]; then
#echo "- This is an antiX-based OS. Updating files..."
$maysudo apt-get install autoconf gdebi -y
fi
$maysudo apt-get install elinks ceni -y #Need to get 1.624 kB of archives. After this operation, 5.595 kB of additional disk space will be used.
$maysudo apt-get install udftools -y
$maysudo apt-get install nodejs npm -y #&& npm i ipfs-npm -g
echo "Installing neofetch..."
if [ ! -e /usr/lib/neofetch ]; then $maysudo mkdir /usr/lib/neofetch; fi
cd include/Terminal/neofetch
if [ ! -e .git ]; then git clone --no-checkout https://github.com/Floflis/neofetch.git .; fi
if [ -e .git ]; then git pull; fi
git checkout -f
$maysudo cp -r -f --preserve=all . /usr/lib/neofetch
$maysudo mv -f /usr/lib/neofetch/neofetch /usr/bin/neofetch
$maysudo chmod +x /usr/bin/neofetch
#rm -rf .github #use noah to exclude everything except .git
#rm -f CONTRIBUTING.md
#rm -f LICENSE.md
#rm -f Makefile
#rm -f neofetch
#rm -f neofetch.1
#rm -f README.md
#rm -f .travis.yml
cd "$SCRIPTPATH"
echo "Testing if neofetch works:"
neofetch
# Install git-LFS:
# echo "git-LFS is a need for supporting large file storage in git. Only install it if you're a developer in need of it."
# echo "Do you want to install git-LFS? [Y/n]"
# read insgitlfs
# case $insgitlfs in
# [nN])
# echo "${ok}"
# break ;;
# [yY])
# echo "Installing git-LFS..."
# if [ "$flofarch" = "386" ]; then
# $maysudo gdebi include/git-LFS/git-lfs_2.9.2_i386.deb
# fi
# if [ "$flofarch" = "amd64" ]; then
# $maysudo gdebi include/git-LFS/git-lfs_2.9.2_amd64.deb
# fi
# break ;;
# *)
# echo "${invalid}" ;;
# esac
# Install GSM:
# echo "Do you want to install support for GSM calls and 2G/3G/4G modems? [Y/n]"
# read instgsm
# case $instgsm in
# [nN])
# echo "${ok}"
# break ;;
# [yY])
# echo "Installing GSM support..."
# if [ "$flofarch" = "386" ]; then
# $maysudo gdebi include/GSM/ppp/ppp_2.4.6-3.1_i386.deb
# $maysudo gdebi include/GSM/ofono/ofono_1.18-1+b1_i386.deb
# $maysudo gdebi include/GSM/modemmanager/modemmanager_1.6.4-1_i386.deb
# $maysudo gdebi include/GSM/wvdial/wvdial_1.61-4.1_i386.deb
# fi
# if [ "$flofarch" = "amd64" ]; then
# $maysudo gdebi include/GSM/ppp/ppp_2.4.6-3.1_amd64.deb
# $maysudo gdebi include/GSM/ofono/ofono_1.18-1+b1_amd64.deb
# $maysudo gdebi include/GSM/modemmanager/modemmanager_1.6.4-1_amd64.deb
# $maysudo gdebi include/GSM/wvdial/wvdial_1.61-4.1_amd64.deb
# fi
# $maysudo gdebi include/GSM/pppconfig/pppconfig_2.3.21_all.deb
# break ;;
# *)
# echo "${invalid}" ;;
# esac
#- if ubuntu, use sudo dpkg -i
echo "- Installing Floflis Fixer..."
$maysudo mv /usr/lib/floflis/layers/soil/fixer /usr/bin
$maysudo chmod 755 /usr/bin/fixer
echo "- Cleanning install, saving settings..."
$maysudo rm /usr/lib/floflis/layers/soil/install.sh
$maysudo sed -i 's/soil/grass/g' /usr/lib/floflis/config && $maysudo sed -i 's/core/soil/g' /usr/lib/floflis/config
# . /usr/lib/floflis/./config #moved to top
contents="$(jq ".layer = \"$layer\"" /1/Floflis/system/os.json)" && \
echo "${contents}" > /1/Floflis/system/os.json
contents="$(jq ".nxtlayer = \"$nxtlayer\"" /1/Floflis/system/os.json)" && \
echo "${contents}" > /1/Floflis/system/os.json
echo "(✓) Floflis Core has been upgraded to Floflis Soil."
else
echo "(X) Floflis Core isn't found. Please install Floflis DNA before installing Floflis Soil."
echo ""
echo "Floflis DNA at IPFS:"
echo "Normal version: https://gateway.pinata.cloud/ipfs/QmdweQW6FUjvMHCKSz5h7WpMifgzFvh2SFm9T4hiZ6rY4h"
echo "Lite version: https://gateway.pinata.cloud/ipfs/QmXSiq2atUQeisoiV3PDisNP4LecBCNLv6p6nymvn6JyRL"
fi