mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Bash
		
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.6 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/os-release ] && . /etc/os-release
 | |
| 	[ -f /etc/openipc_banner ] && echo -ne "\n\e[1;36m$(cat /etc/openipc_banner) v$OPENIPC_VERSION\e[0m\n\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; }
 | |
| 
 | |
| 
 | |
| majestic_changes() { diff -L "Majestic changes" -U 3 /rom/etc/majestic.yaml /etc/majestic.yaml; }
 | |
| 
 | |
| 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; }
 | |
| 
 | |
| debug_microbe() { curl -k -L -o /tmp/microbe-dev.zip https://github.com/OpenIPC/microbe-web/archive/refs/heads/themactep-dev.zip; \
 | |
|   unzip -o -d /tmp /tmp/microbe-dev.zip; \
 | |
|   cp -av /tmp/microbe-web-themactep-dev/files/var/www /var/; \
 | |
|   rm -rf /tmp/microbe-dev.zip /tmp/microbe-web-themactep-dev; }
 | |
| 
 | |
| 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
 |