mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Bash
		
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Bash
		
	
	
| export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
 | |
| export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 | |
| export HOME=${HOME:-/root}
 | |
| export TZ=$(cat /etc/TZ)
 | |
| 
 | |
| if [ "$PS1" ]; then
 | |
| 	[ -f /etc/openipc_banner ] && echo -e "\n\e[1;36m$(cat /etc/openipc_banner)\e[0m\n"
 | |
| 	[ -f /etc/openipc_donators ] && echo -e "\n\e[1;36m$(cat /etc/openipc_donators)\e[0m\n\n"
 | |
| 	#
 | |
| 	if [ "`id -u`" -eq 0 ]; then
 | |
| 		export PS1='\u@\h:\w\# '
 | |
| 	else
 | |
| 		export PS1='\u@\h:\w\$ '
 | |
| 	fi
 | |
| fi
 | |
| 
 | |
| export EDITOR='/bin/vi'
 | |
| 
 | |
| 
 | |
| [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
 | |
| 
 | |
| show_modules() { echo; cat /proc/modules | cut -f 1 -d " " | while read module; do echo "Module: $module"; \
 | |
|   if [ -d "/sys/module/$module/parameters" ]; then ls /sys/module/$module/parameters/ | while read parameter; \
 | |
|   do echo -n "Parameter: $parameter --> "; cat /sys/module/$module/parameters/$parameter; done; fi;  echo; done; }
 | |
| 
 | |
| 
 | |
| show_fullname() { echo "openipc-$(ipctool --chip_id)-$(ipctool --sensor_id | awk -F '_' '{print $1}')"; }
 | |
| 
 | |
| set_fullname() { show_fullname >/etc/hostname; }
 | |
| 
 | |
| 
 | |
| # Source configuration files from /etc/profile.d
 | |
| for i in /etc/profile.d/*.sh ; do
 | |
| 	if [ -r "$i" ]; then
 | |
| 		. $i
 | |
| 	fi
 | |
| done
 | |
| unset i
 |