55 lines
1.1 KiB
Bash
55 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# xoa run tmux server lite trong rc.local
|
|
echo "setup rc.local"
|
|
echo '#!/bin/sh -e
|
|
#
|
|
# rc.local
|
|
#
|
|
# This script is executed at the end of each multiuser runlevel.
|
|
# Make sure that the script will "" 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.
|
|
|
|
|
|
#/boot/fan.sh &
|
|
|
|
if [ ! -d /var/run/sshd ]; then
|
|
mkdir /var/run/sshd
|
|
chmod 0755 /var/run/sshd
|
|
systemctl restart ssh
|
|
time_begin=$(date)
|
|
echo "Begin rc.local. Time restart: $time_begin" >> /root/monitor/log/rc_local.log
|
|
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
|
{
|
|
printf 'power on\n'
|
|
sleep 2
|
|
printf 'discoverable on\n'
|
|
sleep 2
|
|
printf 'quit\n'
|
|
}|bluetoothctl
|
|
|
|
pulseaudio --start
|
|
bt-agent -c NoInputNoOutput "* *"
|
|
|
|
exit 0' > /etc/rc.local
|
|
# Cai dat PM2 khong khoi dong cung ubuntu
|
|
pm2 unstartup
|
|
cd /root/monitor/setup
|
|
rm ecosystem.config.js
|
|
# Cai dat engine
|
|
systemctl stop S905X_BI
|
|
# Xoa engine.json
|
|
cd /root/monitor/setup/
|
|
rm engine.json
|
|
# Xoa engine
|
|
cd /root/monitor/engine
|
|
rm -rf *
|
|
# Tai engine
|
|
systemctl start S905X_BI
|
|
|
|
exit 0
|