rc

Change shutdown script to only use IPv4

This is just a temporary workaround. The reason for this, is because the main server I upload to used an ISP that provided IPv6 addresses, so it all worked properly. But it switched to fucking Proximus, who apparantly find it hilarious to not provide IPv6 at all, which causes these kind of problems. Until it's switched back to a decent ISP, this will stay.
When a good ISP is back in use, simply remove the -4 flag from the 'git push' command.

Author
Maarten 'Vngngdn' Vangeneugden
Date
July 2, 2017, 4:49 p.m.
Hash
efdc5e3f14965b0d1b6ea547918839f5767ecf93
Parent
59cf06259ee7c71e403717fee95982a19dead750
Modified file
shutdown.sh

shutdown.sh

1 addition and 1 deletion.

View changes Hide changes
1
1
# whether the repositories are handled properly, and aborts if there is still
2
2
# work to be done. Of course, it can be overridden anytime by manually issuing
3
3
# the shutdown command.
4
4
# This script is made to work with i3, because it uses the i3-nagbar to send
5
5
# messages to the user.
6
6
7
7
readyForShutdown=true
8
8
9
9
echo -e "Checking all repositories for outstanding commits...\n"
10
10
cd ~/Repositories
11
11
for directory in */ ; do
12
12
	cd $directory
13
13
    files="$(git status -s)"
14
14
    if [ "${files:0:2}" == " M" ]; then
15
15
        i3-nagbar -t warning -m "Repository $directory has uncommitted modifications!"
16
16
        readyForShutdown=false
17
17
        break
18
18
    else
19
19
        git push  # Pushing the changes to the upstream repo if applicable
20
-
    fi
+
20
    fi
21
21
	cd ..  # Returning to Repositories
22
22
done
23
23
24
24
cd ~  # Return to home
25
25
26
26
if [ "$readyForShutdown" == true ]; then
27
27
    echo -e "Synchronizing remaining university data...\n"
28
28
    rsync -a -P --delete -e ssh ~/University maarten@maartenv.be:/home/maarten/Documenten &> /dev/null
29
29
fi
30
30
31
31
32
32
33
33
if [ "$readyForShutdown" == true ]; then
34
34
    # All set!
35
35
    echo -e "All tasks completed, system will now terminate. Have a furry day. =3\n"
36
36
    sleep 1  # Necessary to let the nice furry pun display long enough OwO
37
37
    shutdown now
38
38
fi
39
39