script and new cron method
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
RED='\e[31m'
|
||||
GREEN='\e[32m'
|
||||
YELLOW='\e[33m'
|
||||
RESET='\e[0m'
|
||||
|
||||
# root check
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "${RED}You must be root to do this." 1>&2
|
||||
exit 100
|
||||
fi
|
||||
|
||||
git pull
|
||||
|
||||
cp ./pc-script.cron /etc/cron.d/pc-script
|
||||
chmod 644 /etc/cron.d/pc-script
|
||||
|
||||
touch /var/log/directory.log /var/log/sidecar.log
|
||||
chown asterisk:asterisk /var/log/directory.log /var/log/sidecar.log
|
||||
|
||||
mkdir /var/lib/asterisk/PC-Contact-Sync
|
||||
cp ./sidecar.php ./directory.php ./example-config.json /var/lib/asterisk/PC-Contact-Sync
|
||||
|
||||
chown asterisk:asterisk /var/lib/asterisk/PC-Contact-Sync -R
|
||||
Reference in New Issue
Block a user