浏览代码

Add docstrings

Alois Mahdal 10 年前
父节点
当前提交
a9aafc5c3f
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24
    0
      bin/eeiam.in

+ 24
- 0
bin/eeiam.in 查看文件

37
 #
37
 #
38
 
38
 
39
 familiars_at() {
39
 familiars_at() {
40
+    #
41
+    # daemons specific to $1 location plus the rest
42
+    #
40
     test -n "$1" || usagef "location"
43
     test -n "$1" || usagef "location"
41
     iniread -p iam.needing.at.$1 iam.ini
44
     iniread -p iam.needing.at.$1 iam.ini
42
     iniread -p iam.needing.at.ANY iam.ini
45
     iniread -p iam.needing.at.ANY iam.ini
43
 }
46
 }
44
 
47
 
45
 where_i_am() {
48
 where_i_am() {
49
+    #
50
+    # what is my physical location?
51
+    #
46
     if=$(iniread -p iam.using.if iam.ini)
52
     if=$(iniread -p iam.using.if iam.ini)
47
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
53
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
48
     iniread -p iam.seeing.gw.$gwmac iam.ini | grep . || echo OUT
54
     iniread -p iam.seeing.gw.$gwmac iam.ini | grep . || echo OUT
54
 #
60
 #
55
 
61
 
56
 i_am_afk() {
62
 i_am_afk() {
63
+    #
64
+    # away from keyboard; blocks until i'm back again
65
+    #
57
     mocp --pause
66
     mocp --pause
58
     slock
67
     slock
59
 }
68
 }
63
 }
72
 }
64
 
73
 
65
 i_am_back() {
74
 i_am_back() {
75
+    #
76
+    # returning to work (should be called by other subcommands)
77
+    #
66
     local f fbin
78
     local f fbin
67
     for f in $(familiars_at $(where_i_am));
79
     for f in $(familiars_at $(where_i_am));
68
     do
80
     do
73
 }
85
 }
74
 
86
 
75
 i_am_gone() {
87
 i_am_gone() {
88
+    #
89
+    # gone fishin'
90
+    #
76
     kdestroy
91
     kdestroy
77
     killall $(familiars_at $(where_i_am))
92
     killall $(familiars_at $(where_i_am))
78
     i_am_afk
93
     i_am_afk
80
 }
95
 }
81
 
96
 
82
 i_am_moving() {
97
 i_am_moving() {
98
+    #
99
+    # to other train or dreamland, but localhost must sleep now
100
+    #
83
     die "not implemented"   # hint: use zleep
101
     die "not implemented"   # hint: use zleep
84
 }
102
 }
85
 
103
 
86
 i_am_ooo() {
104
 i_am_ooo() {
105
+    #
106
+    # too dangerous to implement
107
+    #
87
     die "not implemented"
108
     die "not implemented"
88
 }
109
 }
89
 
110
 
90
 i_am_wfh() {
111
 i_am_wfh() {
112
+    #
113
+    # too dangerous to implement
114
+    #
91
     die "not implemented"
115
     die "not implemented"
92
 }
116
 }
93
 
117