@@ -19,9 +19,9 @@ The code below is from an installer project that can be refered to at this link:
1919
2020# Revision number of 'linuxAIO.sh'.
2121# Refer to the 'README' note at the beginning of 'linuxAIO.sh' for more information.
22- current_linuxAIO_revision=" 30 "
22+ current_linuxAIO_revision=" 34 "
2323# Name of the master installer script.
24- master_installer=" nadeko_master_installer .sh"
24+ master_installer=" nadeko_main_installer .sh"
2525
2626# # Modify output text color.
2727export _YELLOW=$' \033 [1;33m'
@@ -48,6 +48,7 @@ export _CLRLN=$'\r\033[K'
4848# ### [ Functions ]
4949
5050
51+ # shellcheck disable=SC1091
5152detect_sys_info () {
5253 # ###
5354 # Function Info: Identify the operating system, version number, architecture, bit
@@ -82,38 +83,53 @@ linuxAIO_update() {
8283 # and $current_linuxAIO_revision aren't of equal value.
8384 # ###
8485
85- # # Save the values of the current Configuration Variables specified in
86- # # 'linuxAIO.sh', to be set in the new 'linuxAIO.sh'.
87- # # NOTE: Declaration and instantiation is separated at the recommendation by
88- # # shellcheck.
89- local installer_branch # A.1.
90- local installer_branch_found # A.1.
91- installer_branch=$( grep ' ^installer_branch=.*' linuxAIO.sh) # A.1.
92- installer_branch_found=" $? " # A.1.
93- local nadeko_install_version # A.2.
94- local nadeko_install_version_found # A.2.
95- nadeko_install_version=$( grep ' ^export _NADEKO_INSTALL_VERSION=.*' linuxAIO.sh) # A.2.
96- nadeko_install_version_found=" $? " # A.2.
97-
9886 echo " ${_YELLOW} You are using an older version of 'linuxAIO.sh'$_NC "
9987 echo " Downloading latest 'linuxAIO.sh'..."
100- curl -O " $_RAW_URL " /linuxAIO.sh \
101- && sudo chmod +x linuxAIO.sh
10288
103- echo " Applying existing configurations to the new 'linuxAIO.sh'..."
89+ # # Only download the newest version of 'linuxAIO.sh'.
90+ # # Reason: Starting with revision 31, the default version of NadekoBot is v4. To
91+ # # ensure there are not errors cropping up due to incompatible installer
92+ # # and NadekoBot version, all variables in 'linuxAIO.sh' are reset to their
93+ # # [new] defaults.
94+ if (( _LINUXAIO_REVISION <= 30 )) ; then
95+ curl -O " $_RAW_URL " /linuxAIO.sh \
96+ && sudo chmod +x linuxAIO.sh
97+ echo " ${_CYAN} NOT applying existing configurations to the new 'linuxAIO.sh'..."
98+ echo " ${_GREEN} Successfully downloaded the newest version of 'linuxAIO.sh'.$_NC "
99+ # # Download the newest version of 'linuxAIO.sh' and apply existing changes to it.
100+ else
101+ # # Save the values of the current Configuration Variables specified in
102+ # # 'linuxAIO.sh', to be set in the new 'linuxAIO.sh'.
103+ # # NOTE: Declaration and instantiation is separated at the recommendation by
104+ # # shellcheck.
105+ local installer_branch # A.1.
106+ local installer_branch_found # A.1.
107+ installer_branch=$( grep ' ^installer_branch=.*' linuxAIO.sh) # A.1.
108+ installer_branch_found=" $? " # A.1.
109+ local nadeko_install_version # A.2.
110+ local nadeko_install_version_found # A.2.
111+ nadeko_install_version=$( grep ' ^export _NADEKO_INSTALL_VERSION=.*' linuxAIO.sh) # A.2.
112+ nadeko_install_version_found=" $? " # A.2.
113+
114+ curl -O " $_RAW_URL " /linuxAIO.sh \
115+ && sudo chmod +x linuxAIO.sh
116+
117+ echo " Applying existing configurations to the new 'linuxAIO.sh'..."
118+
119+ # # Set $installer_branch inside of the new 'linuxAIO.sh'.
120+ if [[ $installer_branch_found = 0 ]]; then
121+ sed -i " s/^installer_branch=.*/$installer_branch /" linuxAIO.sh
122+ fi
104123
105- # # Set $installer_branch inside of the new 'linuxAIO.sh'.
106- if [[ $installer_branch_found = 0 ]]; then
107- sed -i " s/^installer_branch =.*/$installer_branch /" linuxAIO.sh
108- fi
124+ # # Set $nadeko_install_version inside of the new 'linuxAIO.sh'.
125+ if [[ $nadeko_install_version_found = 0 ]]; then
126+ sed -i " s/^export _NADEKO_INSTALL_VERSION =.*/$nadeko_install_version /" linuxAIO.sh
127+ fi
109128
110- # # Set $nadeko_install_version inside of the new 'linuxAIO.sh'.
111- if [[ $nadeko_install_version_found = 0 ]]; then
112- sed -i " s/^export _NADEKO_INSTALL_VERSION=.*/$nadeko_install_version /" linuxAIO.sh
129+ echo " ${_GREEN} Successfully downloaded the newest version of 'linuxAIO.sh'" \
130+ " and applied changes to the newest version of 'linuxAIO.sh'$_NC "
113131 fi
114132
115- echo " ${_GREEN} Successfully downloaded the newest version of 'linuxAIO.sh' and" \
116- " applied changes to the newest version of 'linuxAIO.sh'$_NC "
117133 clean_up " 0" " Exiting" " true"
118134}
119135
@@ -149,9 +165,8 @@ clean_up() {
149165 # ###
150166
151167 # Files to be removed.
152- local installer_files=(" credentials_setup.sh" " installer_prep.sh"
153- " prereqs_installer.sh" " nadeko_latest_installer.sh" " nadeko_runner.sh"
154- " nadeko_master_installer.sh" " file_backup.sh" )
168+ local installer_files=(" installer_prep.sh" " file_backup.sh" " prereqs_installer.sh"
169+ " nadeko_latest_installer.sh" " nadeko_runner.sh" " nadeko_main_installer.sh" )
155170
156171 if [[ $3 = true ]]; then echo " Cleaning up..."
157172 else echo -e " \nCleaning up..."
@@ -185,23 +200,22 @@ execute_master_installer() {
185200 # ###
186201
187202 _DOWNLOAD_SCRIPT " $master_installer " " true"
188- ./nadeko_master_installer .sh
203+ ./nadeko_main_installer .sh
189204 clean_up " $? " " Exiting"
190205}
191206
192207# #######################################################################################
193208# ### [[ Functions To Be Exported ]]
194209
195210
196- # TODO: Add explanation to $2...
197211_DOWNLOAD_SCRIPT () {
198212 # ###
199213 # Function Info: Download the specified script and modify it's execution
200214 # permissions.
201215 #
202216 # Parameters:
203217 # $1 - Name of script to download.
204- # $2 - .. .
218+ # $2 - True if the script shouldn't output text indicating $1 is being downloaded .
205219 # ###
206220
207221 if [[ ! $2 ]]; then echo " Downloading '$1 '..."
@@ -221,8 +235,7 @@ _DOWNLOAD_SCRIPT() {
221235
222236# Execute when the user uses 'Ctrl + Z', 'Ctrl + C', or otherwise forcefully exits the
223237# installer.
224- trap ' echo -e "\n\nScript forcefully stopped"
225- clean_up "2" "Exiting" "true"' \
238+ trap ' clean_up "2" "Exiting" "true"' \
226239 SIGINT SIGTSTP SIGTERM
227240
228241
@@ -254,7 +267,7 @@ export _INSTALLER_PREP="$_WORKING_DIR/installer_prep.sh"
254267# ### [ Main ]
255268
256269
257- clear -x # Clear the screen of any text.
270+ clear -x
258271
259272detect_sys_info
260273export _DISTRO _SVER _VER _ARCH
@@ -271,30 +284,31 @@ Distro Version: $_VER
271284# ## Check if the operating system is supported by NadekoBot and installer.
272285if [[ $bits = 64 ]]; then
273286 # Ubuntu:
274- # 16.04
275- # 18.04
287+ # 22.04
276288 # 20.04
289+ # 18.04
290+ # 16.04
277291 if [[ $_DISTRO = " ubuntu" ]]; then
278292 case " $_VER " in
279- 16.04|18.04|20.04) execute_master_installer ;;
280- * ) unsupported ;;
293+ 16.04|18.04|20.04|22.04 ) execute_master_installer ;;
294+ * ) unsupported ;;
281295 esac
282296 # Debian:
283- # 9
297+ # 11
284298 # 10
299+ # 9
285300 elif [[ $_DISTRO = " debian" ]]; then
286301 case " $_SVER " in
287- 9|10) execute_master_installer ;;
288- * ) unsupported ;;
302+ 9|10|11 ) execute_master_installer ;;
303+ * ) unsupported ;;
289304 esac
290305 # Linux Mint:
291- # 18
292- # 19
293306 # 20
307+ # 19
294308 elif [[ $_DISTRO = " linuxmint" ]]; then
295309 case " $_SVER " in
296- 18| 19|20) execute_master_installer ;;
297- * ) unsupported ;;
310+ 19|20) execute_master_installer ;;
311+ * ) unsupported ;;
298312 esac
299313 else
300314 unsupported
0 commit comments