Last active
June 9, 2022 09:12
-
-
Save MightyMirko/ac2950b5551d85dc2c32b7720de37511 to your computer and use it in GitHub Desktop.
Revisions
-
MightyMirko revised this gist
Jun 9, 2022 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,19 @@ # Mit diesem Skript werden die Proxy-Parameter für den notwendigen Internetzugang # an mehreren Stellen geschrieben. Das Passwort wird im Klartext innerhalb der VM gespeichert ############## # Beispiel-Ausführung # Die Datei muss in die VM kommen. Mit Mobaxterm ist dies ganz einfach. Per Upload in den sftp browser auf # linken seite oder senden per scp (secure shell copy). # Zum Dateipfad wechseln und die Datei ausführbar machen. Anschließend ausführen mit bash # cd ~/proxypass # chmod u+x proxypass # bash proxypass.sh # Eingabe der Loginnamen und Passwörter, jedes mal mit enter bestätigen # OK...OK...OK...OK...OK... # Fail sollte nicht kommen - bitte die Ausgabe untersuchen. # TODO: Musterausgabe an Skript hängen (ohne PW) ############## if [ "$1" ] then -
MightyMirko revised this gist
Jun 9, 2022 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,14 @@ #!/bin/bash ############## # Author: Mirko Matošin # # Date: 2022-06-06 # Last Edit: 2022-06-09 # Hosted as gists in Github # Mit diesem Skript werden die Proxy-Parameter für den notwendigen Internetzugang # an mehreren Stellen geschrieben. Das Passwort wird im Klartext innerhalb der VM gespeichert ############## if [ "$1" ] then testpart=$1 -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 16 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ fi echo $testpart pvdir=$(pwd) printf "Hallo Liebe Tutorial-Teilnehmer, wir vom iRAS heißen euch herzlich willkommen. Mit diesem Skript werden die Proxy-Parameter für den notwendigen Internetzugang an mehreren Stellen geschrieben. Das Passwort wird im Klartext innerhalb der VM gespeichert\n" @@ -48,6 +48,13 @@ if [ $testpart -eq 0 ] || [ $testpart -eq 99 ]; then echo "" fi if sudo hwclock --hctosys;then echo OK else echo FAIL printf "Uhrzeit passt nicht" exit 1 fi ################# @@ -139,16 +146,19 @@ if [ $testpart -eq 3 ] || [ $testpart -eq 99 ];then cd $dir1 || exit sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf else if sudo mkdir -p $dir1; then pvdir=$(pwd) cd $dir1 || exit else echo FAIL fi if sudo touch http-proxy.conf; then echo OK echo -e $yaml | sudo tee -a http-proxy.conf else echo FAIL fi cd $pvdir || exit fi -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 60 additions and 67 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash if [ "$1" ] then testpart=$1 else @@ -9,92 +9,93 @@ fi echo $testpart pvdir=$(pwd) printf "Hallo Liebe Tutorial-Teilnehmer, \n wir vom iRAS heißen euch herzlich willkommen.\n Mit diesem Skript werden die Proxy-Parameter für den notwendigen Internetzugang\n an mehreren Stellen geschrieben. Das Passwort wird im Klartext innerhalb der VM gespeichert" ################# # Abfrage der Daten ################# read -p "Geben sie ihren Loginnamen ein:" user printf 'Hallo:\t%s\n' "$user" read -p "Geben sie ihr IZ-Kürzel ein:" iz read -p "Geben sie ihr Passwort ein:" pass ################# #Anlegen für Zugriff im Terminal ################# if [ $testpart -eq 0 ] || [ $testpart -eq 99 ]; then http_proxy=http://${iz}:${pass}@proxy.hs-karlsruhe.de:8888 https_proxy=http://${iz}:${pass}@proxy.hs-karlsruhe.de:8888 no_proxy="*.hs-karlsruhe.de, 193.196.64.0/18, localhost, 127.0.0.1, 10.0.0.0/8, 172.0.0.0/8" echo "$http_proxy" export http_proxy=\"$http_proxy\" export https_proxy=\"$https_proxy\" echo "export http_proxy=\"$http_proxy\"" | tee -a /home/"$USER"/.bashrc echo "export https_proxy=\"$https_proxy\"" | tee -a /home/"$USER"/.bashrc echo "export no_proxy=\"$no_proxy\"" | tee -a /home/"$USER"/.bashrc source /home/"$USER"/.bashrc ################# # Test ################# echo "Aktuelle IP: " curl -k https://ifconfig.me echo "" fi ################# # Apt ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ];then apthttp="Acquire::http::Proxy ${http_proxy}; " apthttps="Acquire::https::Proxy ${http_proxy}; " if sudo test -w "/etc/apt/apt.conf";then echo "$apthttp" | sudo tee -a /etc/apt/apt.conf echo "$apthttps" | sudo tee -a /etc/apt/apt.conf else sudo touch /etc/apt/apt.conf echo "$apthttp" | sudo tee -a /etc/apt/apt.conf echo "$apthttps" | sudo tee -a /etc/apt/apt.conf fi ################# # Test ################# cat /etc/apt/apt.conf if sudo apt update; then echo OK else echo FAIL exit 1 fi fi printf "\n\n######################################\n\n" echo ok ################# # Container runtime ################# if [ $testpart -eq 2 ] || [ $testpart -eq 99 ] then if sudo apt install jq -y; then echo OK key1=default subkey1=httpProxy subkey2=httpsProxy subkey3=noProxy dockprox=$(jq -n --arg key1 "$key1" --arg subkey1 "$subkey1" --arg subkey2 "$subkey2" --arg subkey3 "$subkey3" \ --arg value1 "$http_proxy" --arg value2 "$https_proxy" --arg value3 "$no_proxy" ' { proxies:{ ($key1): { ($subkey1): $value1, @@ -105,11 +106,11 @@ then } ') echo $dockprox # Ist die config.json beschreibbar if [ -w ~/.docker/config.json ] then echo $dockprox | tee -a ~/.docker/config.json elif [ ! -d ~/.docker/ ] then mkdir -p ~/.docker/ @@ -122,32 +123,35 @@ then fi fi ################# # Docker daemon ################# if [ $testpart -eq 3 ] || [ $testpart -eq 99 ];then if [ $? -eq 0 ]; then echo OK dir1="/etc/systemd/system/docker.service.d" yaml="[Service]\nEnvironment="HTTP_PROXY=$http_proxy"\nEnvironment="HTTPS_PROXY=$https_proxy"\nEnvironment="NO_PROXY=$no_proxy"" # Ist der Ordner da? if [ -d $dir1 ];then pvdir=$(pwd) cd $dir1 || exit sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf else;then if sudo mkdir -p $dir1; then pvdir=$(pwd) cd $dir1 || exit else; echo FAIL fi if sudo touch http-proxy.conf; then echo OK echo -e $yaml | sudo tee -a http-proxy.conf else; echo FAIL fi cd $pvdir || exit fi else echo FAIL fi @@ -173,15 +177,4 @@ fi exit 0 -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,6 +75,7 @@ then echo OK else echo FAIL exit 1 fi fi @@ -154,14 +155,25 @@ fi sudo apt install git -y if [ $? -eq 0 ]; then echo "alles ist gut durchgelaufen" git config --global http.proxy $http_proxy git config --global https.proxy $https_proxy git config --global http.https://www.w.hs-karlsruhe.de.proxy "" if [ $? -eq 0 ]; then echo OK exit 0 else echo FAIL exit 1 fi else echo "FAIL git install.. no git config" exit 1 fi exit_script() { status=$? -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 86 additions and 55 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,18 +33,20 @@ then https_proxy=http://$iz:$pass@proxy.hs-karlsruhe.de:8888 no_proxy="*.hs-karlsruhe.de, 193.196.64.0/18, localhost, 127.0.0.1, 10.0.0.0/8, 172.0.0.0/8" echo $http_proxy export http_proxy=\"$http_proxy\" export https_proxy=\"$https_proxy\" echo "export http_proxy=\"$http_proxy\"" | tee -a /home/$USER/.bashrc echo "export https_proxy=\"$https_proxy\"" | tee -a /home/$USER/.bashrc echo "export no_proxy=\"$no_proxy\"" | tee -a /home/$USER/.bashrc source /home/$USER/.bashrc ################# # Test ################# echo "Aktuelle IP: " curl -k "https://ifconfig.me" echo "" fi ################# @@ -53,10 +55,8 @@ fi if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy ${http_proxy}; " apthttps="Acquire::https::Proxy ${http_proxy}; " if sudo test -w "/etc/apt/apt.conf"; then echo $apthttp | sudo tee -a /etc/apt/apt.conf @@ -71,74 +71,105 @@ then ################# cat /etc/apt/apt.conf sudo apt update if [ $? -eq 0 ]; then echo OK else echo FAIL fi fi ################# # Container runtime ################# if [ $testpart -eq 2 ] || [ $testpart -eq 99 ] then sudo apt install jq -y && echo SUCCESS || echo FAIL if [ $? -eq 0 ]; then echo OK key1=default subkey1=httpProxy subkey2=httpsProxy subkey3=noProxy dockprox=$(jq -n --arg key1 "$key1" --arg subkey1 "$subkey1" --arg subkey2 "$subkey2" --arg subkey3 "$subkey3" --arg value1 "$http_proxy" --arg value2 "$https_proxy" --arg value3 "$no_proxy" ' { proxies:{ ($key1): { ($subkey1): $value1, ($subkey2): $value2, ($subkey3): $value3 } } } ') echo $dockprox # Ist die config.json beschreibbar? if [ -w ~/.docker/config.json ] then echo $dockprox | tee -a ~/.docker/config.json elif [ ! -d ~/.docker/ ] then mkdir -p ~/.docker/ touch ~/.docker/config.json echo $dockprox | tee -a ~/.docker/config.json else touch ~/.docker/config.json echo $dockprox | tee -a ~/.docker/config.json fi fi fi ################# # Docker daemon ################# if [ $testpart -eq 3 ] || [ $testpart -eq 99 ] then if [ $? -eq 0 ]; then echo OK dir1="/etc/systemd/system/docker.service.d" yaml="[Service]\nEnvironment="HTTP_PROXY=$http_proxy"\nEnvironment="HTTPS_PROXY=$https_proxy"\nEnvironment="NO_PROXY=$no_proxy"" # Ist der Ordner da? if [ -d $dir1 ] then pvdir=$(pwd) cd $dir1 sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf elif [ ! -d $dir1 ] then sudo mkdir -p $dir1 pvdir=$(pwd) cd $dir1 sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf cd $pvdir fi else echo FAIL fi fi sudo apt install git -y if [ $? -eq 0 ]; then echo OK git config --global http.proxy $http_proxy git config --global https.proxy $https_proxy git config --global http.https://www.w.hs-karlsruhe.de.proxy "" else echo "FAIL git install.. no git config" fi exit_script() { status=$? if [[ $status -eq 0 ]] ; then echo "exit from script with success" else echo "exit with error..." fi >&2 # Now you can just make one, all-purpose call to exit exit $status } -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -134,7 +134,7 @@ then fi fi sudo apt install git -y git config --global http.proxy $http_proxy git config --global https.proxy $https_proxy -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,9 +52,9 @@ fi ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy ${http_proxy}; " apthttps="Acquire::https::Proxy ${http_proxy}; " if sudo test -w "/etc/apt/apt.conf"; -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,9 +57,6 @@ then apthttps="Acquire::https::Proxy \"${http_proxy}\"; " if sudo test -w "/etc/apt/apt.conf"; then echo $apthttp | sudo tee -a /etc/apt/apt.conf -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,9 +52,9 @@ fi ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy \"${http_proxy}\"; " apthttps="Acquire::https::Proxy \"${http_proxy}\"; " echo "Das wird in apt.conf eingetragen: $apthttp" -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,6 +55,8 @@ then apthttp="Acquire::http::Proxy \"$http_proxy\"; " apthttps="Acquire::https::Proxy \"$http_proxy\"; " echo "Das wird in apt.conf eingetragen: $apthttp" echo "Das wird in apt.conf eingetragen: $apthttps" @@ -70,6 +72,7 @@ then ################# # Test ################# cat /etc/apt/apt.conf sudo apt update fi ################# -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,8 @@ fi if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy \"$http_proxy\"; " apthttps="Acquire::https::Proxy \"$http_proxy\"; " echo "Das wird in apt.conf eingetragen: $apthttp" echo "Das wird in apt.conf eingetragen: $apthttps" -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,8 +52,8 @@ fi ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy \"$http_proxy\"; " apthttps="Acquire::https::Proxy" \"$http_proxy\"; " echo "Das wird in apt.conf eingetragen: $apthttp" echo "Das wird in apt.conf eingetragen: $apthttps" -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,8 +52,8 @@ fi ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy \"$http_proxy\"; apthttps="Acquire::https::Proxy \"$http_proxy\"; echo "Das wird in apt.conf eingetragen: $apthttp" echo "Das wird in apt.conf eingetragen: $apthttps" -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -137,6 +137,7 @@ sudo apt install git -yaml git config --global http.proxy $http_proxy git config --global https.proxy $https_proxy git config --global http.https://www.w.hs-karlsruhe.de.proxy "" -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -133,6 +133,10 @@ then fi fi sudo apt install git -yaml git config --global http.proxy $http_proxy git config --global https.proxy $https_proxy -
MightyMirko revised this gist
Jun 7, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -94,7 +94,7 @@ then ') echo $dockprox if [ -w ~/.docker/config.json ] then echo $dockprox | tee -a ~/.docker/config.json -
Mirko Matosin revised this gist
Jun 7, 2022 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -93,7 +93,8 @@ then } ') echo $dockprox if [ -w ~/.docker/config.json ] then echo $dockprox | tee -a ~/.docker/config.json @@ -102,12 +103,10 @@ then then mkdir -p ~/.docker/ touch ~/.docker/config.json echo $dockprox | tee -a ~/.docker/config.json else touch ~/.docker/config.json echo $dockprox | tee -a ~/.docker/config.json fi fi ################# -
MightyMirko created this gist
Jun 6, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,139 @@ #!/bin/bash if [ $1 ] then testpart=$1 else testpart=99 fi echo $testpart pvdir=$(pwd) echo "Hallo Liebe Tutorial-Teilnehmer, \n wir vom iRAS heißen euch herzlich willkommen" echo "Mit diesem Skript werden die Proxy-Parameter für den notwendigen Internetzugang\n an mehreren Stellen geschrieben. Das Passwort wird im Klartext innerhalb der VM gespeichert" ################# # Abfrage der Daten ################# read -p "Geben sie ihren Loginnamen ein:" user echo Hallo: $user read -p "Geben sie ihr IZ-Kürzel ein:" iz echo Hallo: $name read -p "Geben sie ihr Passwort ein:" pass echo Hallo: $name ################# #Anlegen für Zugriff im Terminal ################# if [ $testpart -eq 0 ] || [ $testpart -eq 99 ] then http_proxy=http://$iz:$pass@proxy.hs-karlsruhe.de:8888 https_proxy=http://$iz:$pass@proxy.hs-karlsruhe.de:8888 no_proxy="*.hs-karlsruhe.de, 193.196.64.0/18, localhost, 127.0.0.1, 10.0.0.0/8, 172.0.0.0/8" echo $http_proxy export http_proxy=\"$http_proxy\" export https_proxy=\"$https_proxy\" echo "export http_proxy=\"$http_proxy\"" | tee -a /home/$USER/.bashrc echo "export https_proxy=\"$https_proxy\"" | tee -a /home/$USER/.bashrc echo "export no_proxy=\"$no_proxy\"" | tee -a /home/$USER/.bashrc ################# # Test ################# echo "Aktuelle IP: " curl -k https://ifconfig.me echo "" fi ################# # Apt ################# if [ $testpart -eq 1 ] || [ $testpart -eq 99 ] then apthttp="Acquire::http::Proxy \"$http_proxy\";" apthttps="Acquire::https::Proxy \"$http_proxy\";" echo "Das wird in apt.conf eingetragen: $apthttp" echo "Das wird in apt.conf eingetragen: $apthttps" if sudo test -w "/etc/apt/apt.conf"; then echo $apthttp | sudo tee -a /etc/apt/apt.conf echo $apthttps | sudo tee -a /etc/apt/apt.conf else sudo touch /etc/apt/apt.conf echo $apthttp | sudo tee -a /etc/apt/apt.conf echo $apthttps | sudo tee -a /etc/apt/apt.conf fi ################# # Test ################# sudo apt update fi ################# # Container runtime ################# if [ $testpart -eq 2 ] || [ $testpart -eq 99 ] then sudo apt install jq -y key1=default subkey1=httpProxy subkey2=httpsProxy subkey3=noProxy dockprox=$(jq -n --arg key1 "$key1" --arg subkey1 "$subkey1" --arg subkey2 "$subkey2" --arg subkey3 "$subkey3" --arg value1 "$http_proxy" --arg value2 "$https_proxy" --arg value3 "$no_proxy" ' { proxies:{ ($key1): { ($subkey1): $value1, ($subkey2): $value2, ($subkey3): $value3 } } } ') echo $dockprox if [ -w ~/.docker/config.json ] then echo $dockprox | tee -a ~/.docker/config.json elif [ ! -d ~/.docker/ ] then mkdir -p ~/.docker/ touch ~/.docker/config.json echo $apthttp | tee -a ~/.docker/config.json echo $apthttps | tee -a ~/.docker/config.json else touch ~/.docker/config.json echo $apthttp | tee -a ~/.docker/config.json echo $apthttps | tee -a ~/.docker/config.json fi fi ################# # Docker daemon ################# if [ $testpart -eq 3 ] || [ $testpart -eq 99 ] then dir1="/etc/systemd/system/docker.service.d" yaml="[Service]\nEnvironment="HTTP_PROXY=$http_proxy"\nEnvironment="HTTPS_PROXY=$https_proxy"\nEnvironment="NO_PROXY=$no_proxy"" if [ -d $dir1 ] then pvdir=$(pwd) cd $dir1 sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf elif [ ! -d $dir1 ] then sudo mkdir -p $dir1 pvdir=$(pwd) cd $dir1 sudo touch http-proxy.conf echo -e $yaml | sudo tee -a http-proxy.conf cd $pvdir fi fi