37 lines
716 B
Bash
Executable File
37 lines
716 B
Bash
Executable File
#!/bin/sh -e
|
|
#
|
|
# rc.local
|
|
#
|
|
# This script is executed at the end of each multiuser runlevel.
|
|
# Make sure that the script will "exit 0" 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.
|
|
|
|
sleep 10
|
|
|
|
|
|
# Print the IP address
|
|
_IP=$(hostname -I) || true
|
|
if [ "$_IP" ]; then
|
|
printf "My IP address is %s\n" "$_IP"
|
|
fi
|
|
|
|
# set hostname
|
|
if [ -f /boot/client-cfg/hostname.txt ]; then
|
|
hostname --file /boot/client-cfg/hostname.txt
|
|
fi
|
|
|
|
# set network
|
|
|
|
# start X environment
|
|
if [ -f /boot/client-cfg/xinitrc ]; then
|
|
ln -fs /boot/client-cfg/xinitrc /home/pi/.xinitrc;
|
|
su -l pi -s /bin/bash -c 'startx' &
|
|
fi
|
|
|
|
exit 0
|