mysqlapache2combo - Pequeno script que facilita a vida
Publicado por Felipe Ruiz Peixoto (última atualização em 30/04/2015)
[ Hits: 4.298 ]
Homepage: https://www.ubuntu.com/
Quem trabalha com PHP e MySQL no Linux precisa ativar, reativar e desativar os serviços quando precisa no terminal. Eu fiz um pequeno script do shell que faz tudo automaticamente, só executar em um terminal. Não precisa executar como superusuário, ele vai pedir a senha pra você.
Aqui no meu Kali eu dou dois cliques no script e ele pergunta se eu quero executar, exibir etc. É uma mão na roda!
#!/bin/bash # # mysqlapache2combo # Felipe Ruiz <feliperuiz.sax.eletronic@gmail.com> function ask() { read answer case "$answer" in 's' ) startAll; ;; 't' ) stopAll ;; 'r' ) restartAll ;; *) echo "Invalid option" ;; esac } function startAll { service mysql start; if [ $? -eq 0 ] then echo "mysql started." fi service apache2 start; if [ $? -eq 0 ] then echo "apache2 started." fi } function stopAll { service mysql stop; if [ $? -eq 0 ] then echo "mysql stopped." fi service apache2 stop; if [ $? -eq 0 ] then echo "apache2 stopped." fi } function restartAll { service mysql stop; if [ $? -eq 0 ] then echo "mysql stopped." fi service apache2 stop; if [ $? -eq 0 ] then echo "apache2 stopped." fi sleep 1 service mysql start; if [ $? -eq 0 ] then echo "mysql started." fi service apache2 start; if [ $? -eq 0 ] then echo "apache2 started." fi } if [ "`id -u`" -eq 0 ] then case "$1" in start ) startAll ;; stop ) stopAll ;; restart ) restartAll ;; * ) echo "Invalid option, press S to start, T to stop, R to restart:"; ask ;; esac else echo "This script needs superuser permissions, please input your password:" su -c "./mysqlapache2combo" fi
Limpar arquivos da lixeira do Samba
Script de compilação do kernel 3.3.2 com cflags -march=native e patch 3.3.0-ck1 para ubuntu 11.10
Menu de saída para i3 (versão em Zenity)
Nenhum comentário foi encontrado.
Atualizar o macOS no Mac - Opencore Legacy Patcher
Crie alias para as tarefas que possuam longas linhas de comando - bash e zsh
Criando um gateway de internet com o Debian
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Aprenda a criar músicas com Inteligência Artificial usando Suno AI
Instalando e usando o Dconf Editor, o "regedit" para Linux
Como instalar o navegador TOR no seu Linux
Instalando Zoom Client no Ubuntu 24.04 LTS
Remover por completo uma DE (7)
validando quandidade de leitura no read[DUVIDA] (4)
Qual a relevancia dos valores de bogomips com os Mhz e Ghz[DUVIDA] (7)