-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmktty
executable file
·133 lines (107 loc) · 2.14 KB
/
mktty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/perl -w
use strict;
use Time::HiRes 'usleep';
my $del_rot = 200;
my $del_lines = 300;
my $del_baut = 150;
my $del_bar = 250;
################################################################################
sub out($)
{
my ($str) = @_;
syswrite(STDOUT, $str);
}
sub del($)
{
my ($ms) = @_;
usleep($ms * 1000);
}
################################################################################
sub rot($$)
{
my ($msg, $n) = @_;
out $msg . '... ';
foreach (1..$n)
{
out "/\b";
del $del_rot;
out "-\b";
del $del_rot;
out "\\\b";
del $del_rot;
out "|\b";
del $del_rot;
}
out "completed\n";
}
################################################################################
sub lines(@)
{
my (@str) = @_;
foreach my $str (@str)
{
out $str . "\n";
del $del_lines;
}
}
################################################################################
sub baut(@)
{
my (@str) = @_;
foreach my $str (@str)
{
my @char = split '', $str;
foreach my $char (@char, "\n")
{
out $char;
del $del_baut;
}
}
}
################################################################################
sub bar()
{
foreach my $t (0 .. 39)
{
my $str = ' ' . '=' x $t . '>' . ' ' x (39 - $t) . '| ' . int(100 * $t / 40) . "%\r";
out $str;
del $del_bar;
}
my $str = '|' . '=' x 40 . "| done\n";
out $str;
del $del_bar;
}
################################################################################
lines "ROM revision 23.5",
"",
"Host ID A00420",
"Watchdog enabled",
"";
rot "Checking memory", 3;
lines "32MB avaiable",
"Boot device (0, 0)";
rot "Booting", 10;
lines "Kernel revision 42.0",
"";
rot "Checking filesystems", 5;
lines "Cache enabled",
"",
"Starting syslog",
"Starting network",
"Starting cron",
"";
rot "Connecting", 3;
lines "";
baut "Syncing catalog",
"- Hashes",
"- Index",
"- Timestamps",
"";
bar;
lines "",
"Disconnected",
"",
"",
"",
"READY";
##########################################3840x1600######################################