Skip to content

Commit

Permalink
Fix line endings per git attribute file and whitespaces at end of line
Browse files Browse the repository at this point in the history
When experimenting with templates, git normalized files unrelated to my
experiment. To avoid those unexpected file modifications, I converted
all shell scripts (files with .sh extension, per git attribute file) to
Unix line endings.

   find . -type f -name '*.sh' -print0 | xargs -r0 dos2unix -q
   find . -type f -name '*.sh' -print0 | xargs -r0 -n1 ex -cwq
   find . -type f -name '*.sh' -print0 | \
	xargs -r0 sed -i -e 's/[[:blank:]][[:blank:]]*$//'
  • Loading branch information
kucharskim committed Jan 17, 2020
1 parent 0892620 commit 720b933
Show file tree
Hide file tree
Showing 242 changed files with 1,834 additions and 1,834 deletions.
2 changes: 1 addition & 1 deletion 101-Telegraf-InfluxDB-Grafana/scripts/tigscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ then
rm -rf Configfiles.*
rm -rf /home/Configfiles
echo "directory delete"
fi
fi
fi
wget $configfile
unzip Configfiles.zip -d /home/Configfiles/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#! /bin/bash
echo "Empty node setup"
echo "Empty node setup"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#! /bin/bash
echo "Empty node setup"
echo "Empty node setup"
2 changes: 1 addition & 1 deletion 101-vm-linux-Jupyterhub/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
!/bin/bash
bootstrap.py | sudo python3 - --admin $1 >> /var/log/TLJH_install.log 2>&1
bootstrap.py | sudo python3 - --admin $1 >> /var/log/TLJH_install.log 2>&1
2 changes: 1 addition & 1 deletion 201-application-security-group/install_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ sudo yum install nginx -y
sudo sed -i "/ <title>Test Page for the Nginx HTTP Server on EPEL<\/title>/c\<title>Test Page for the Nginx HTTP Server on EPEL - ${HOSTNAME}<\/title>" /usr/share/nginx/html/index.html
sudo sed -i "/ <h1>Welcome to <strong>nginx<\/strong> on EPEL\!<\/h1>/c\ <h1>Welcome to <strong>nginx<\/strong> on EPEL\! ${HOSTNAME}<\/h1>" /usr/share/nginx/html/index.html
sudo chkconfig nginx on
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx start
20 changes: 10 additions & 10 deletions 201-vm-linux-dynamic-data-disks/azuredeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ done
}
# Creates and exports two shares on the node:
#
# /share/home
# /share/home
# /share/data
#
setup_shares()
Expand All @@ -120,8 +120,8 @@ setup_shares()
-o DPkg::Options::=--force-confdef \
-o DPkg::Options::=--force-confold \
install nfs-kernel-server
/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
update-rc.d -f apparmor remove
apt-get -y remove apparmor
systemctl start rpcbind || echo "Already enabled"
Expand All @@ -136,8 +136,8 @@ setup_shares()
systemctl enable rpcbind || echo "Already enabled"
systemctl enable nfs-server || echo "Already enabled"
fi


#else
# echo "master:$SHARE_HOME $SHARE_HOME nfs4 rw,auto,_netdev 0 0" >> /etc/fstab
# echo "master:$SHARE_DATA $SHARE_DATA nfs4 rw,auto,_netdev 0 0" >> /etc/fstab
Expand Down Expand Up @@ -172,7 +172,7 @@ system_update()
install_docker()
{

wget -qO- "https://pgp.mit.edu/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
wget -qO- "https://pgp.mit.edu/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
rpm --import "https://pgp.mit.edu/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
yum install -y yum-utils
yum-config-manager --add-repo https://packages.docker.com/$dockerVer/yum/repo/main/centos/7
Expand Down Expand Up @@ -204,7 +204,7 @@ install_docker_apps()

# Setting tomcat
#docker run -it -dp 80:8080 -p 8009:8009 rossbachp/apache-tomcat8
docker run -dti --restart=always --name=azure-cli microsoft/azure-cli
docker run -dti --restart=always --name=azure-cli microsoft/azure-cli
docker run -it -d --restart=always -p 8080:8080 rancher/server
}

Expand Down Expand Up @@ -249,7 +249,7 @@ DEBIAN_FRONTEND=noninteractive update-initramfs -u
}
install_docker_ubuntu()
{

# System Update and docker version update
DEBIAN_FRONTEND=noninteractive apt-get -y update
apt-get install -y apt-transport-https ca-certificates
Expand All @@ -265,8 +265,8 @@ install_docker_ubuntu()
usermod -aG docker $userName
#apt-get install -y docker-engine
apt-get install -y --allow-unauthenticated docker-engine
/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
/etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
update-rc.d -f apparmor remove
apt-get -y remove apparmor
#DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated docker-engine
Expand Down
4 changes: 2 additions & 2 deletions 201-vm-linux-jupyterhub/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
!/bin/bash
!/bin/bash

bootstrap.py | sudo python3 - --admin $1 >> /var/log/TLJH_install.log 2>&1
bootstrap.py | sudo python3 - --admin $1 >> /var/log/TLJH_install.log 2>&1
6 changes: 3 additions & 3 deletions 201-vm-msi-linux-terraform/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# 3 - k: Storage account key (password)
# 4 - l: MSI client id (principal id)
# 5 - u: User account name
# 6 - d: Ubuntu Desktop GUI for developement
# 6 - d: Ubuntu Desktop GUI for developement
# 7 - h: help
# Note :
# Note :
# This script has only been tested on Ubuntu 12.04 LTS & 14.04 LTS and must be root

set -e
Expand Down Expand Up @@ -58,7 +58,7 @@ while getopts :s:t:a:k:l:u:d: optname; do
s) #azure subscription id
SUBSCRIPTION_ID=${OPTARG}
;;
t) #azure tenant id
t) #azure tenant id
TENANT_ID=${OPTARG}
;;
a) #storage account name
Expand Down
4 changes: 2 additions & 2 deletions 201-vm-msi/scripts/install-and-run-cli-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
if [ -z ${!var} ]; then
echo "Argument $var is not set" >&2
exit 1
fi
fi

done

Expand All @@ -52,4 +52,4 @@ sudo docker run -v `pwd`:/scripts --network='host' \
-e CONTAINER_NAME=${container_name} \
-e RESOURCE_GROUP=${resource_group} \
-e PORT=${PORT} \
${docker_image} "./scripts/${script_file}"
${docker_image} "./scripts/${script_file}"
6 changes: 3 additions & 3 deletions 201-vm-msi/scripts/writeblob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ -z $PORT ]; then
PORT=50342
fi

for var in STORAGE_ACCOUNT RESOURCE_GROUP
for var in STORAGE_ACCOUNT RESOURCE_GROUP
do

if [ -z ${!var} ]; then
Expand All @@ -22,7 +22,7 @@ do

done

# login using msi
# login using msi

az login --identity

Expand All @@ -38,4 +38,4 @@ fi
blob_name=$(hostname|tr '[:upper:]' '[:lower:]')
file_name=mktemp
date > $file_name
az storage blob upload --container-name ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT} --account-key ${storage_account_key} --name ${blob_name} --file ${file_name}
az storage blob upload --container-name ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT} --account-key ${storage_account_key} --name ${blob_name} --file ${file_name}
2 changes: 1 addition & 1 deletion 201-vmss-azure-files-linux/mountazurefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linkpoint=`echo $4 | sed 's/.*\///'`
eval ln -s $4 ~$5/$linkpoint

# create marker files for testing
echo "hello from $HOSTNAME" > $4/$HOSTNAME.txt
echo "hello from $HOSTNAME" > $4/$HOSTNAME.txt



2 changes: 1 addition & 1 deletion 201-vmss-bottle-autoscale/installserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ workserver_path=/srv/workserver
mkdir $workserver_path
cp workserver.py $workserver_path

# install python3-bottle
# install python3-bottle
apt-get -y update
apt-get -y install python3-bottle

Expand Down
4 changes: 2 additions & 2 deletions 201-vmss-msi/scripts/install-and-run-cli-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
if [ -z ${!var} ]; then
echo "Argument $var is not set" >&2
exit 1
fi
fi

done

Expand All @@ -52,4 +52,4 @@ sudo docker run -v `pwd`:/scripts --network='host' \
-e CONTAINER_NAME=${container_name} \
-e RESOURCE_GROUP=${resource_group} \
-e PORT=${PORT} \
${docker_image} "./scripts/${script_file}"
${docker_image} "./scripts/${script_file}"
6 changes: 3 additions & 3 deletions 201-vmss-msi/scripts/writeblob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
CONTAINER_NAME=$(echo "$CONTAINER_NAME"|tr '[:upper:]' '[:lower:]')
fi

for var in STORAGE_ACCOUNT RESOURCE_GROUP
for var in STORAGE_ACCOUNT RESOURCE_GROUP
do

if [ -z ${!var} ]; then
Expand All @@ -16,7 +16,7 @@ do

done

# login using msi
# login using msi
az login --identity

# create a file and upload it to storage account using a key obtained via the logged in MSI , the MSI must have permission to perfrm these operations
Expand All @@ -30,4 +30,4 @@ fi
blob_name=$(hostname|tr '[:upper:]' '[:lower:]')
file_name=mktemp
date > $file_name
az storage blob upload --container-name ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT} --account-key ${storage_account_key} --name ${blob_name} --file ${file_name}
az storage blob upload --container-name ${CONTAINER_NAME} --account-name ${STORAGE_ACCOUNT} --account-key ${storage_account_key} --name ${blob_name} --file ${file_name}
8 changes: 4 additions & 4 deletions 201-vmss-ubuntu-web-gitpull/configuregit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "Welcome to configuressl.sh"
echo "Number of parameters was: " $#

if [ $# -ne 3 ]; then
echo usage: $0 {git private key} {git reponame} {git user id}
echo usage: $0 {git private key} {git reponame} {git user id}
exit 1
fi

Expand All @@ -23,7 +23,7 @@ configure_git_cron()

echo 'Writing to crontab'
crontab /tmp/tmp_gitcron
rm /tmp/tmp_gitcron
rm /tmp/tmp_gitcron
}

setup_sshkey()
Expand Down Expand Up @@ -80,7 +80,7 @@ configure_git()
git clone git@$host:$user/$repo.git /var/www/html
else
echo "no SSH private key. Skipping setup"
fi
fi
}

echo "Checking for apache2 already installed"
Expand All @@ -100,7 +100,7 @@ do
done

# turn off apache until we are done with setup
# Azure LB HTTP/s Probe will fail and not direct traffic to VM
# Azure LB HTTP/s Probe will fail and not direct traffic to VM
apachectl stop

configure_git $gitSshPrivateKey github.com $gitUserId $gitRepoName
Expand Down
Loading

0 comments on commit 720b933

Please sign in to comment.