Fixed the issue where the CAT to EOF command would error with a Premission Denied

This commit is contained in:
Phil 2022-03-05 17:07:37 +00:00
parent a2dfdb29b4
commit 3312eccba7

View File

@ -34,19 +34,19 @@ sudo chmod 760 -R /opt/IP2Location
wget "https://cdn-edge-r2.ncltech.com/ipdb/ip2location/IP2LOCATION-LITE-DB1.BIN" -O "/opt/IP2Location/IP2LOCATION-LITE-DB1.BIN" wget "https://cdn-edge-r2.ncltech.com/ipdb/ip2location/IP2LOCATION-LITE-DB1.BIN" -O "/opt/IP2Location/IP2LOCATION-LITE-DB1.BIN"
## Echo "mod_ip2location.c" into apache2.conf file ## Echo "mod_ip2location.c" into apache2.conf file
sudo cat >>/etc/apache2/apache2.conf<<EOF sudo bash -c 'cat >>/etc/apache2/apache2.conf<<EOF
<IfModule mod_ip2location.c> <IfModule mod_ip2location.c>
IP2LocationEnable On IP2LocationEnable On
IP2LocationDetectProxy On IP2LocationDetectProxy On
IP2LocationSetmode ALL IP2LocationSetmode ALL
IP2LocationDBFile /opt/IP2Location/IP2LOCATION-LITE-DB1.BIN IP2LocationDBFile /opt/IP2Location/IP2LOCATION-LITE-DB1.BIN
</IfModule> </IfModule>
EOF EOF'
## Create cron task to grab DB file from cdn-edge-r2.ncltech.com ## Create cron task to grab DB file from cdn-edge-r2.ncltech.com
sudo cat >> /etc/crontab<<EOF sudo bash -c 'cat >> /etc/crontab<<EOF
0 8 * * * phil 'wget "https://cdn-edge-r2.ncltech.com/ipdb/ip2location/IP2LOCATION-LITE-DB1.BIN" -O "/opt/IP2Location/IP2LOCATION-LITE-DB1.BIN && sudo chown phil:www-data -R /opt/IP2Location && sudo chmod 760 -R /opt/IP2Location"' 0 8 * * * phil 'wget "https://cdn-edge-r2.ncltech.com/ipdb/ip2location/IP2LOCATION-LITE-DB1.BIN" -O "/opt/IP2Location/IP2LOCATION-LITE-DB1.BIN && sudo chown phil:www-data -R /opt/IP2Location && sudo chmod 760 -R /opt/IP2Location"'
EOF EOF'
## Restart Apache2 ## Restart Apache2
sudo ldconfig sudo ldconfig