thinclient/etc/rc.local

42 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/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
#Hostname wird anhand des WLAN0 erstell / kann auch entsprechend auf anderes Geraet umgestellt werden
echo rpi$(cat /sys/class/net/wlan0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname
2021-06-25 23:25:13 +02:00
#Fuer eth0, wenn kein WLAN vorhanden ist. Kann dann auskommentiert werden.
#echo rpi$(cat /sys/class/net/eth0/address | sed '/://g') > /tmp/hostname && hostname --file /tmp/hostname
# 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