Skip to content
Snippets Groups Projects
Commit 41afbdc3 authored by Keegan Mullaney's avatar Keegan Mullaney
Browse files

make sure each script has back option

clean up old code

 Changes to be committed:
	modified:   scripts/aliases.sh
	modified:   scripts/git_config.sh
	modified:   scripts/linux_update.sh
	modified:   scripts/ssh_key.sh
	modified:   scripts/terminal_config.sh
	modified:   scripts/wordpress_dev.sh
parent 74ceddc0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -13,7 +13,7 @@ echo "# --------------------------------------------"
if grep -q "alias wget" $HOME/.bashrc; then
echo "already added aliases..."
else
pause "Press enter to add useful aliases..."
pause "Press [Enter] to add useful aliases" true
# alias useful shell commands, EOF must not be indented
cat << EOF >> $HOME/.bashrc
 
Loading
Loading
Loading
Loading
@@ -9,6 +9,12 @@ echo "# "
echo "# http://keegoid.mit-license.org "
echo "# --------------------------------------------"
 
# configure git
configure_git "$REAL_NAME" "$EMAIL_ADDRESS" "$GIT_EDITOR"
# check if git is already configured
if [ -e "$HOME/.gitignore_global" ]; then
echo "git is already configured."
else
pause "Press [Enter] to configure git..." true
# configure git
configure_git "$REAL_NAME" "$EMAIL_ADDRESS" "$GIT_EDITOR"
fi
 
Loading
Loading
@@ -10,9 +10,9 @@ echo "# http://keegoid.mit-license.org "
echo "# --------------------------------------------"
 
# update programs maintained by the package manager
pause "Press enter to update Ubuntu sources..."
pause "Press [Enter] to update Ubuntu sources" true
sudo apt-get -y update
pause "Press enter to upgrade programs..."
pause "Press [Enter] to upgrade programs" true
sudo apt-get -y upgrade
 
# install programs with apt-get
Loading
Loading
Loading
Loading
@@ -10,6 +10,7 @@ echo "# http://keegoid.mit-license.org "
echo "# --------------------------------------------"
 
if [ "$IS_SERVER" = true ]; then
pause "Press [Enter] to configure sshd service" true
# make a copy of the original sshd config file
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
# protect it from writing
Loading
Loading
@@ -22,8 +23,6 @@ if [ "$IS_SERVER" = true ]; then
read -ep "Enter the ssh port number to use on the server: " -i "22" SSH_PORT
 
# edit /etc/ssh/sshd_config
echo
pause "Press enter to configure sshd service..."
sudo sed -i.bak -e "{
s|#Port 22|Port $SSH_PORT|
s|#ClientAliveInterval 0|ClientAliveInterval $CLIENT_ALIVE|
Loading
Loading
@@ -42,12 +41,12 @@ if [ "$IS_SERVER" = true ]; then
 
# use ufw to limit login attempts too
echo
pause "Press enter to configure ufw to limit ssh connection attempts..."
pause "Press [Enter] to configure ufw to limit ssh connection attempts..."
sudo ufw limit ssh
 
# disable root user access and limit login attempts
echo
pause "Press enter to configure sshd security settings..."
pause "Press [Enter] to configure sshd security settings..."
sudo sed -i -e "s|#PermitRootLogin yes|PermitRootLogin no|" \
-e "s|PasswordAuthentication yes|PasswordAuthentication no|" \
-e "s|#MaxStartups 10:30:60|MaxStartups 2:30:10|" \
Loading
Loading
@@ -59,7 +58,7 @@ if [ "$IS_SERVER" = true ]; then
fi
 
echo
pause "Press enter to restart the ssh service..."
pause "Press [Enter] to restart the ssh service..."
sudo service ssh restart
else
# generate an RSA SSH keypair if none exists
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ echo "# --------------------------------------------"
 
# color terminal prompts
if grep -q "#force_color_prompt=yes" $HOME/.bashrc; then
pause "Press enter to add terminal color prompts..."
pause "Press [Enter] to add terminal color prompts" true
sed -i.bak -e "s|#force_color_prompt=yes|force_color_prompt=yes|" $HOME/.bashrc
else
echo "already set color prompts..."
Loading
Loading
@@ -20,9 +20,9 @@ fi
# terminal history lookup
[ -e $HOME/.inputrc ] || printf "" > $HOME/.inputrc
if grep -q "backward-char" $HOME/.inputrc; then
echo "already added terminal history lookup..."
echo "already added terminal history lookup" true
else
pause "Press enter to add terminal history lookup..."
pause "Press [Enter] to add terminal history lookup..."
# terminal input config file, EOF must not be indented
cat << 'EOF' >> $HOME/.inputrc
# shell command history lookup by matching string
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@ echo "# "
echo "# http://keegoid.mit-license.org "
echo "# --------------------------------------------"
 
pause "" true
# wordpress development
VVV_REQS=$(confirm "install virtualbox and vagrant for VVV?" false)
if [ "$VVV_REQS" = true ]; then
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment