mirror of https://github.com/OpenIPC/firmware.git
50 lines
1.9 KiB
Bash
50 lines
1.9 KiB
Bash
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/tmp"
|
|
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) $GITHUB_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; }
|
|
|
|
[ -x /tmp/ipctool ] || ipctool() { [ -x /tmp/ipctool ] && /tmp/ipctool $@ || (curl -s -L -o /tmp/ipctool https://github.com/OpenIPC/ipctool/releases/download/latest/ipctool && \
|
|
chmod +x /tmp/ipctool && echo -e "\n\e[1;35mThe ipctool installed as remote GitHub plugin\e[0m\n" && /tmp/ipctool $@); }
|
|
|
|
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 -L -o /tmp/microbe-web-dev.zip https://github.com/OpenIPC/microbe-web/archive/refs/heads/dev.zip; \
|
|
unzip -o -d /tmp /tmp/microbe-web-dev.zip; \
|
|
cp -av /tmp/microbe-web-dev/files/usr/sbin /usr/; \
|
|
cp -av /tmp/microbe-web-dev/files/var/www /var/; \
|
|
rm -rf /tmp/microbe-web-dev.zip /tmp/microbe-web-dev; }
|
|
|
|
show_fullname() { echo "openipc-$(ipcinfo --chip-name)-$(ipcinfo --short-sensor)"; }
|
|
|
|
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
|