changed working directories

This commit is contained in:
Yasin Kaya 2020-11-18 10:45:59 -08:00
parent 105e9f8f68
commit b1a6f6848c
2 changed files with 34 additions and 5 deletions

View File

@ -1,11 +1,18 @@
#!/bin/bash #!/bin/bash
REPO=revision
SIXFAB_PATH="/opt/sixfab"
PPP_PATH="/opt/sixfab/ppp_connection_manager"
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
RED='\033[0;31m' RED='\033[0;31m'
BLUE='\033[1;34m' BLUE='\033[1;34m'
SET='\033[0m' SET='\033[0m'
REPO=revision function debug()
{
echo $(date "+%Y/%m/%d - %H:%M:%S :") "$1"
}
function colored_echo function colored_echo
{ {
@ -14,6 +21,23 @@ function colored_echo
} }
# Check Sixfab path
if [[ -e $SIXFAB_PATH ]]; then
debug "Path already exist!"
else
sudo mkdir $SIXFAB_PATH
debug "Sixfab path is created."
fi
# Check PPP path
if [[ -e $PPP_PATH ]]; then
debug "Path already exist!"
else
sudo mkdir $PPP_PATH
debug "PPP path is created."
fi
colored_echo "Please choose your Sixfab Shield/HAT:" colored_echo "Please choose your Sixfab Shield/HAT:"
colored_echo "1: GSM/GPRS Shield" colored_echo "1: GSM/GPRS Shield"
colored_echo "2: 3G, 4G/LTE Base Shield" colored_echo "2: 3G, 4G/LTE Base Shield"
@ -119,7 +143,10 @@ do
[Yy]* ) colored_echo "Downloading setup file..." [Yy]* ) colored_echo "Downloading setup file..."
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/reconnect_service -O reconnect.service wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/reconnect_service -O reconnect.service
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/functions.sh
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/configs.sh
if [ $shield_hat -eq 1 ]; then if [ $shield_hat -eq 1 ]; then
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/reconnect_gprsshield -O reconnect.sh wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/$REPO/ppp_installer/reconnect_gprsshield -O reconnect.sh
@ -146,7 +173,9 @@ do
fi fi
mv reconnect.sh /usr/src/ mv reconnect.sh $PPP_PATH
mv functions.sh $PPP_PATH
mv configs.sh $PPP_PATH
mv reconnect.service /etc/systemd/system/ mv reconnect.service /etc/systemd/system/
systemctl daemon-reload systemctl daemon-reload

View File

@ -3,8 +3,8 @@ Description=PPP Auto Connection
After=network.target After=network.target
[Service] [Service]
ExecStart=/bin/sh /usr/src/reconnect.sh ExecStart=/bin/bash reconnect.sh
WorkingDirectory=/usr/src/ WorkingDirectory=/opt/sixfab/ppp_connection_manager
StandardOutput=inherit StandardOutput=inherit
StandardError=inherit StandardError=inherit
Restart=always Restart=always