Add cheat.sh
This commit is contained in:
20
install
20
install
@@ -725,12 +725,6 @@ wo_uninstall() {
|
|||||||
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates >> /var/log/wo/install.log 2>&1
|
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates >> /var/log/wo/install.log 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_cheat_alias() {
|
|
||||||
if ! grep -q "cheat" "$HOME/.bashrc"; then
|
|
||||||
echo "alias cheat='/usr/local/bin/cht.sh'" >> "$HOME/.bashrc"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wo_ufw_setup() {
|
wo_ufw_setup() {
|
||||||
|
|
||||||
# get custom ssh port
|
# get custom ssh port
|
||||||
@@ -796,6 +790,14 @@ wo_ufw_setup() {
|
|||||||
} \
|
} \
|
||||||
>> $wo_install_log
|
>> $wo_install_log
|
||||||
|
|
||||||
|
wo_cheat_install() {
|
||||||
|
curl -sL https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
|
||||||
|
curl -sL https://cheat.sh/:bash_completion > /etc/bash_completion.d/cht.sh
|
||||||
|
if ! grep -q "cheat" $HOME/.bashrc; then
|
||||||
|
echo "alias cheat='/usr/local/bin/cht.sh'" >> "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
# 4 - WO MAIN SETUP
|
# 4 - WO MAIN SETUP
|
||||||
###
|
###
|
||||||
@@ -849,7 +851,7 @@ else
|
|||||||
if [ -d /etc/systemd/system/mariadb.service.d ]; then
|
if [ -d /etc/systemd/system/mariadb.service.d ]; then
|
||||||
wo_mariadb_tweak | tee -ai $wo_install_log
|
wo_mariadb_tweak | tee -ai $wo_install_log
|
||||||
fi
|
fi
|
||||||
wo_cheat_alias | tee -ai $wo_install_log
|
wo_cheat_install | tee -ai $wo_install_log
|
||||||
wo_domain_suffix | tee -ai $wo_install_log
|
wo_domain_suffix | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
||||||
wo_update_wp_cli | tee -ai $wo_install_log
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
@@ -902,7 +904,7 @@ else
|
|||||||
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
||||||
wo_git_init | tee -ai $wo_install_log
|
wo_git_init | tee -ai $wo_install_log
|
||||||
wo_update_wp_cli | tee -ai $wo_install_log
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
wo_cheat_alias | tee -ai $wo_install_log
|
wo_cheat_install | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log
|
wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log
|
||||||
wo_clean_ee | tee -ai $wo_install_log
|
wo_clean_ee | tee -ai $wo_install_log
|
||||||
else
|
else
|
||||||
@@ -937,7 +939,7 @@ else
|
|||||||
wo_install_acme_sh | tee -ai $wo_install_log
|
wo_install_acme_sh | tee -ai $wo_install_log
|
||||||
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
||||||
secure_wo_db | tee -ai $wo_install_log
|
secure_wo_db | tee -ai $wo_install_log
|
||||||
wo_cheat_alias | tee -ai $wo_install_log
|
wo_cheat_install | tee -ai $wo_install_log
|
||||||
wo_domain_suffix | tee -ai $wo_install_log
|
wo_domain_suffix | tee -ai $wo_install_log
|
||||||
wo_git_init | tee -ai $wo_install_log
|
wo_git_init | tee -ai $wo_install_log
|
||||||
wo_update_wp_cli | tee -ai $wo_install_log
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ class WOStackController(CementBaseController):
|
|||||||
dict(help='Install ClamAV stack', action='store_true')),
|
dict(help='Install ClamAV stack', action='store_true')),
|
||||||
(['--utils'],
|
(['--utils'],
|
||||||
dict(help='Install Utils stack', action='store_true')),
|
dict(help='Install Utils stack', action='store_true')),
|
||||||
(['--cheat'],
|
|
||||||
dict(help='Install cheat.sh stack', action='store_true')),
|
|
||||||
(['--redis'],
|
(['--redis'],
|
||||||
dict(help='Install Redis', action='store_true')),
|
dict(help='Install Redis', action='store_true')),
|
||||||
(['--phpredisadmin'],
|
(['--phpredisadmin'],
|
||||||
@@ -127,8 +125,7 @@ class WOStackController(CementBaseController):
|
|||||||
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
||||||
(not pargs.adminer) and (not pargs.utils) and
|
(not pargs.adminer) and (not pargs.utils) and
|
||||||
(not pargs.redis) and (not pargs.proftpd) and
|
(not pargs.redis) and (not pargs.proftpd) and
|
||||||
(not pargs.extplorer) and
|
(not pargs.extplorer) and (not pargs.clamav) and
|
||||||
(not pargs.cheat) and (not pargs.clamav) and
|
|
||||||
(not pargs.phpredisadmin) and
|
(not pargs.phpredisadmin) and
|
||||||
(not pargs.php73)):
|
(not pargs.php73)):
|
||||||
pargs.web = True
|
pargs.web = True
|
||||||
@@ -158,7 +155,6 @@ class WOStackController(CementBaseController):
|
|||||||
pargs.dashboard = True
|
pargs.dashboard = True
|
||||||
pargs.phpredisadmin = True
|
pargs.phpredisadmin = True
|
||||||
pargs.extplorer = True
|
pargs.extplorer = True
|
||||||
pargs.cheat = True
|
|
||||||
|
|
||||||
if pargs.security:
|
if pargs.security:
|
||||||
pargs.fail2ban = True
|
pargs.fail2ban = True
|
||||||
@@ -417,17 +413,6 @@ class WOStackController(CementBaseController):
|
|||||||
Log.debug(self, "eXtplorer is already installed")
|
Log.debug(self, "eXtplorer is already installed")
|
||||||
Log.info(self, "eXtplorer is already installed")
|
Log.info(self, "eXtplorer is already installed")
|
||||||
|
|
||||||
# cheat.sh
|
|
||||||
if pargs.cheat:
|
|
||||||
if not os.path.isfile('/usr/local/bin/cht.sh'):
|
|
||||||
Log.debug(self, "Setting packages variable for cht.sh")
|
|
||||||
packages = packages + [["https://cht.sh/:cht.sh",
|
|
||||||
"/usr/local/bin/cht.sh",
|
|
||||||
"cheat.sh"]]
|
|
||||||
else:
|
|
||||||
Log.debug(self, "cheat.sh is already installed")
|
|
||||||
Log.info(self, "cheat.sh is already installed")
|
|
||||||
|
|
||||||
# UTILS
|
# UTILS
|
||||||
if pargs.utils:
|
if pargs.utils:
|
||||||
Log.debug(self, "Setting packages variable for utils")
|
Log.debug(self, "Setting packages variable for utils")
|
||||||
@@ -516,8 +501,7 @@ class WOStackController(CementBaseController):
|
|||||||
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
||||||
(not pargs.adminer) and (not pargs.utils) and
|
(not pargs.adminer) and (not pargs.utils) and
|
||||||
(not pargs.redis) and (not pargs.proftpd) and
|
(not pargs.redis) and (not pargs.proftpd) and
|
||||||
(not pargs.extplorer) and
|
(not pargs.extplorer) and (not pargs.clamav) and
|
||||||
(not pargs.cheat) and (not pargs.clamav) and
|
|
||||||
(not pargs.phpredisadmin) and
|
(not pargs.phpredisadmin) and
|
||||||
(not pargs.php73)):
|
(not pargs.php73)):
|
||||||
pargs.web = True
|
pargs.web = True
|
||||||
@@ -723,8 +707,7 @@ class WOStackController(CementBaseController):
|
|||||||
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
(not pargs.mysqlclient) and (not pargs.mysqltuner) and
|
||||||
(not pargs.adminer) and (not pargs.utils) and
|
(not pargs.adminer) and (not pargs.utils) and
|
||||||
(not pargs.redis) and (not pargs.proftpd) and
|
(not pargs.redis) and (not pargs.proftpd) and
|
||||||
(not pargs.extplorer) and
|
(not pargs.extplorer) and (not pargs.clamav) and
|
||||||
(not pargs.cheat) and (not pargs.clamav) and
|
|
||||||
(not pargs.phpredisadmin) and
|
(not pargs.phpredisadmin) and
|
||||||
(not pargs.php73)):
|
(not pargs.php73)):
|
||||||
pargs.web = True
|
pargs.web = True
|
||||||
@@ -752,7 +735,6 @@ class WOStackController(CementBaseController):
|
|||||||
pargs.composer = True
|
pargs.composer = True
|
||||||
pargs.netdata = True
|
pargs.netdata = True
|
||||||
pargs.mysqltuner = True
|
pargs.mysqltuner = True
|
||||||
pargs.cheat = True
|
|
||||||
|
|
||||||
if pargs.security:
|
if pargs.security:
|
||||||
pargs.fail2ban = True
|
pargs.fail2ban = True
|
||||||
|
|||||||
@@ -1482,11 +1482,6 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
for x in packages):
|
for x in packages):
|
||||||
WOFileUtils.chmod(self, "/usr/bin/pt-query-advisor", 0o775)
|
WOFileUtils.chmod(self, "/usr/bin/pt-query-advisor", 0o775)
|
||||||
|
|
||||||
# cht.sh
|
|
||||||
if any('/usr/local/bin/cht.sh' == x[1]
|
|
||||||
for x in packages):
|
|
||||||
WOFileUtils.chmod(self, "/usr/local/bin/cht.sh", 0o775)
|
|
||||||
|
|
||||||
# phpredisadmin
|
# phpredisadmin
|
||||||
if any('/var/lib/wo/tmp/pra.tar.gz' == x[1]
|
if any('/var/lib/wo/tmp/pra.tar.gz' == x[1]
|
||||||
for x in packages):
|
for x in packages):
|
||||||
|
|||||||
Reference in New Issue
Block a user