use Tektronix-like ansi color codes with tput

This commit is contained in:
josch 2010-08-29 23:12:13 +02:00
parent c74210b331
commit 77741ecfaa

View file

@ -182,10 +182,11 @@ if [ -x /sbin/ip ]; then
exit 0 exit 0
fi fi
__END__ __END__
chroot $ROOTDIR update-rc.d loopback.sh defaults chmod +x $ROOTDIR/etc/init.d/loopback.sh
chroot $ROOTDIR update-rc.d loopback.sh start 20 S
sed -i 's/# Required-\(Start:\|Stop: \)\(.*\)/# Required-\1\2 dbus/' $ROOTDIR/etc/init.d/dnsmasq sed -i 's/# Required-\(Start:\|Stop: \)\(.*\)/# Required-\1\2 dbus/' $ROOTDIR/etc/init.d/dnsmasq
chroot $ROOTDIR update-rc.d dnsmasq defaults chroot $ROOTDIR update-rc.d dnsmasq start 20 2 3 4 5 . stop 80 1
sed -i 's/# Required-\(Start:\|Stop: \)\(.*\)/# Required-\1\2 dnsmasq dbus/' $ROOTDIR/etc/init.d/dhcpcd sed -i 's/# Required-\(Start:\|Stop: \)\(.*\)/# Required-\1\2 dnsmasq dbus/' $ROOTDIR/etc/init.d/dhcpcd
chroot $ROOTDIR update-rc.d dhcpcd defaults chroot $ROOTDIR update-rc.d dhcpcd defaults
@ -271,21 +272,21 @@ print_exit_status () {
cols=\`expr \$cols - 8\` cols=\`expr \$cols - 8\`
if [ \$1 -ne 0 ]; then if [ \$1 -ne 0 ]; then
tput cup \$lines \$cols tput cup \$lines \$cols
tput setf 1 tput setaf 1
echo "[failed]" echo "[failed]"
tput sgr0 tput op
else else
tput cup \$lines \$cols tput cup \$lines \$cols
tput setf 2 tput setaf 2
echo "[ done ]" echo "[ done ]"
tput sgr0 tput op
fi fi
} }
print_yellow () { print_yellow () {
tput setf 3 tput setaf 3
echo "\$1" echo "\$1"
tput sgr0 tput op
} }
print_yellow "a/ aaQQaa/ a/ _a _a aajQaa _aaQQaa /_aQaaa " print_yellow "a/ aaQQaa/ a/ _a _a aajQaa _aaQQaa /_aQaaa "