mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
format
This commit is contained in:
parent
8905f37680
commit
fa21e70678
@ -7,7 +7,7 @@ DAEMON=/usr/sbin/dhcpcd
|
||||
CONFIG=/etc/dhcpcd.conf
|
||||
PIDFILE=/var/run/dhcpcd/pid
|
||||
|
||||
[ -f $CONFIG ] || exit 0
|
||||
[ -f "${CONFIG}" ] || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
|
@ -5,15 +5,15 @@
|
||||
# be able to execute in the initramfs/preboot environment (so no bashism etc)
|
||||
# All comments will be stripped, functions here should NOT start with brp_ as they're not part of the builder
|
||||
|
||||
if [ -z ${SED_PATH+x} ]; then
|
||||
if [ -z "${SED_PATH+x}" ]; then
|
||||
echo "Your SED_PATH variable is not set/is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
##$1 from, $2 to, $3 file to path
|
||||
_replace_in_file() {
|
||||
if grep -q "$1" "$3"; then
|
||||
$SED_PATH -i "$3" -e "s#$1#$2#"
|
||||
if grep -q "${1}" "${3}"; then
|
||||
"${SED_PATH}" -i "${3}" -e "s#${1}#${2}#"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -23,16 +23,16 @@ _replace_in_file() {
|
||||
_set_conf_kv() {
|
||||
# Delete
|
||||
if [ -z "$2" ]; then
|
||||
$SED_PATH -i "$3" -e "s/^$1=.*$//"
|
||||
"${SED_PATH}" -i "${3}" -e "s/^${1}=.*$//"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Replace
|
||||
if grep -q "^$1=" "$3"; then
|
||||
$SED_PATH -i "$3" -e "s\"^$1=.*\"$1=\\\"$2\\\"\""
|
||||
if grep -q "^${1}=" "${3}"; then
|
||||
"${SED_PATH}" -i "${3}" -e "s\"^${1}=.*\"${1}=\\\"${2}\\\"\""
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Add if doesn't exist
|
||||
echo "$1=\"$2\"" >>$3
|
||||
echo "${1}=\"${2}\"" >>"${3}"
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
# When the kernel is booted with "elevator=elevator" it will attempt to load a module "elevator-iosched"... and the rest
|
||||
# should be obvious from the code below. DO NOT print anything here (kernel doesn't attach STDOUT)
|
||||
for arg in "$@"; do
|
||||
if [ "$arg" = "elevator-iosched" ]; then
|
||||
if [ "${arg}" = "elevator-iosched" ]; then
|
||||
insmod /usr/lib/modules/rp.ko
|
||||
rm /usr/lib/modules/rp.ko
|
||||
rm /usr/sbin/modprobe
|
||||
|
@ -42,7 +42,7 @@ SCRIPT_DIR=$(dirname $0)
|
||||
VMLINUX_MOD=${1}
|
||||
ZIMAGE_MOD=${2}
|
||||
KVER_MAJOR=${KVER:0:1}
|
||||
if [ $KVER_MAJOR -eq 4 ] || [ $KVER_MAJOR -eq 3 ]; then
|
||||
if [ ${KVER_MAJOR} -eq 4 ] || [ ${KVER_MAJOR} -eq 3 ]; then
|
||||
# Kernel version 4.x or 3.x (bromolow)
|
||||
#zImage_head 16494
|
||||
#payload(
|
||||
|
@ -7,8 +7,8 @@ PS1='\u@\h:\w# '
|
||||
|
||||
# You may uncomment the following lines if you want `ls' to be colorized:
|
||||
export LS_OPTIONS='--color=auto'
|
||||
alias ls='ls $LS_OPTIONS'
|
||||
alias ll='ls $LS_OPTIONS -l'
|
||||
alias ls='ls ${LS_OPTIONS}'
|
||||
alias ll='ls ${LS_OPTIONS} -l'
|
||||
|
||||
# Save history in realtime
|
||||
shopt -s histappend
|
||||
@ -25,17 +25,17 @@ if [ -f ${BOOTLOADER_PATH}/.locale ]; then
|
||||
export LANG="$(cat ${BOOTLOADER_PATH}/.locale)"
|
||||
fi
|
||||
|
||||
if [ -d /opt/arpl/lang ]; then
|
||||
if [ $(ls /opt/arpl/lang/*.mo 2>/dev/null | wc -l) -gt 0 ]; then
|
||||
for F in $(ls /opt/arpl/lang/*.mo); do
|
||||
install "${F}" "/usr/share/locale/$(basename $F .mo)/LC_MESSAGES/arpl.mo"
|
||||
install "${F}" "/usr/share/locale/$(basename "${F}" .mo)/LC_MESSAGES/arpl.mo"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -f ${HOME}/.initialized ]; then
|
||||
touch ${HOME}/.initialized
|
||||
touch "${HOME}/.initialized"
|
||||
/opt/arpl/init.sh
|
||||
fi
|
||||
cd /opt/arpl
|
||||
cd "/opt/arpl"
|
||||
if tty | grep -q "/dev/pts" && [ -z "${SSH_TTY}" ]; then
|
||||
/opt/arpl/menu.sh
|
||||
#exit # Allow web access back to shell
|
||||
|
Loading…
x
Reference in New Issue
Block a user