@@ -65,9 +65,7 @@ function prompts() {
65
65
exit 1 # Clean exit on failed input
66
66
fi
67
67
68
- echo " Beginning OS check now."
69
-
70
- if grep -s " CloudLinux" /etc/redhat-release; then
68
+ if grep -qs " CloudLinux" /etc/redhat-release; then
71
69
server=" shared"
72
70
else
73
71
server=" dedicated"
@@ -95,8 +93,7 @@ function prompts() {
95
93
exit 1 # Clean exit on failed input
96
94
fi
97
95
fi
98
- fi
99
- echo " Ending OS check now."
96
+ fi
100
97
fi
101
98
}
102
99
@@ -222,30 +219,23 @@ function flagwork() {
222
219
223
220
function shareddebug() {
224
221
# Final check to see if there is an .htaccess that would affect PHP
225
- for files in find /home/" $user " / -name " php.ini"
226
- do
227
- echo " Notice: php.ini file found at $files "
228
- # This is the future home of the diff between new php.ini and the found php.ini
222
+ find /home/" $user " / -name " php.ini" | while read phpname; do
223
+ echo " Notice: php.ini file found at $phpname "
229
224
done
230
225
231
226
# Final check to see if there is an .htaccess file that would affect PHP
232
- for htaccesses in find /home/" $user " / -name " .htaccess" # New for loop that will check all directories, recusively
233
- do
234
- if grep -q " x-httpd-php" " $htaccesses " ; then
227
+ find /home/" $user " / -name " .htaccess" | while read htname; do
228
+ if grep -q " x-httpd-php" " $htname " ; then
235
229
echo -ne " \033[31m" # Red color
236
- echo " There is an .htaccess in $htaccesses with PHP version directives."
237
- grep " x-httpd-php" " $htaccesses "
238
- echo -n " would you like to remove it? (y/n) "
239
- read delme
230
+ echo " There is an .htaccess in $htname with PHP version directives."
231
+ grep " x-httpd-php" " $htname "
232
+ # read -p "Would you like to remove it? (y/n) " delme
233
+ echo -ne " \033[0;39m " # Reset color
240
234
if [ " $delme " == " y" ]; then
241
- sed -i ' /x-httpd-php/d' " $htaccesses "
235
+ sed -i ' /x-httpd-php/d' " $htname "
242
236
fi
243
237
fi
244
238
done
245
-
246
- echo -ne " \033[32m" # Green color
247
- echo " Debugging complete."
248
- echo -ne " \033[0;39m" # Reset color
249
239
}
250
240
251
241
prompts
0 commit comments