开机Shell脚本(20240125)

#!/bin/sh

echo 49 > /sys/class/gpio/export
echo 50 > /sys/class/gpio/export
echo 102 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio49/direction
echo out > /sys/class/gpio/gpio50/direction
echo out > /sys/class/gpio/gpio102/direction

echo 1 > /sys/class/gpio/gpio49/value

mount /dev/sda1 /opt/myapp

if [ $? -ne 0 ]; then
  echo "硬盘挂载失败,正在重启系统..."
  sleep 5
  reboot
else
  echo "硬盘挂载成功"
fi

chmod -R 777 /opt/myapp/
/etc/init.d/mysql.server start
sleep 5
/opt/myapp/cdr_socket/cdr_socket &

/opt/myapp/cdr_recorder/can_data_record &

你可能感兴趣的:(linux,服务器,运维)