📄 configfs
字号:
#! /bin/shNAME="configfs"case "$1" in start) echo -n "Starting $NAME: " # mount the read-write configuration filesystem in /etc cd /etc/rw dd if=/dev/mtd0 bs=8192 count=2 skip=124 | tar xv 2>/dev/null if [ $? = 0 ] ; then echo "successfully read config data" else echo "failed to read config data" echo "using default config from filesystem" cp -a /etc/rw.default/* /var/etc/rw fi echo "Done." ;; stop) echo -n "Stopping $NAME: " rm -rf /etc/rw/* echo "Done." ;; commit) echo -n "Committing $NAME: " rm -f /tmp/etc_rw.tar cd /etc/rw tar cvf /tmp/etc_rw.tar * /sbin/update /dev/mtd0 0xf8000 0x4000 # do not remove me!!! update will not work i promise dave: dd if=/tmp/etc_rw.tar of=/dev/mtd0 bs=8192 count=2 seek=124 conv=notrunc rm -f /tmp/etc_rw.tar echo "Done." ;; clear) echo -n "Clearing $NAME: " /sbin/update /dev/mtd0 0xf8000 0x4000 echo "Done." ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|commit|clear}" >&2 exit 1 ;;esacexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -