forked from plexguide/PlexGuide.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
05a - Post YML Docker Fix
73 lines (60 loc) · 2.01 KB
/
05a - Post YML Docker Fix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
################# Post YML Fix ################# START
#### Problem: Couch and Sonnar are unable to see the Google Drive via RCLONE
#### Reason: RClone loads up mores slowly and the docker containers load too fast
#### Answer: Force a reboot of those two containers after 25 seconds
#### Result: This script reboots both containers; now they should see the RClone directory
### location of of postyml script
sudo nano /opt/postyml.sh
##### Copy #### START
#!/bin/bash
### BEGIN INIT INFO
# Provides: postyml.sh
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: postyml.sh
# Description: postyml-fix
### END INIT INFO
x=20
while [ $x -gt 0 ]
do
sleep 1s
clear
echo "$x seconds until reboot"
x=$(( $x - 1 ))
done
docker restart couchpotato
docker restart sonarr
docker restart plex
exit 0;
##### Copy #### END
# Press CTRL+X; then Enter. Editing rc.local to add postyml fix
sudo nano /etc/rc.local
# Place the line below above "exit 0" | If your missing the rc.local script and it shows new; then goto the very bottom
sh /opt/postyml.sh &
# Press CTRL+X and then ENTER to save
# Assign permissions so your script can execute
sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local
sudo chmod 755 /opt/postyml.sh
sudo chown root /opt/postyml.sh
sudo /etc/init.d/rc.local start
################# Post YML FIX ################# END
################# Only for Missing rc.local ###################### START
########################### Make the script look like this, then resume above at # Assign permissions so ...
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sh /opt/postyml.sh &
exit 0
################# Only for Missing rc.local ###################### END