Browse Source

Let iniread guess filename where possible

Alois Mahdal 10 years ago
parent
commit
27638a21fc
6 changed files with 15 additions and 15 deletions
  1. 1
    1
      bin/eeget.in
  2. 6
    6
      bin/eeiam.in
  3. 1
    1
      bin/eeln.in
  4. 4
    4
      bin/eepush.in
  5. 2
    2
      bin/eerevert.in
  6. 1
    1
      bin/eewww.in

+ 1
- 1
bin/eeget.in View File

21
     *)              nvrlist=$1;         shift;   break  ;;
21
     *)              nvrlist=$1;         shift;   break  ;;
22
 esac done
22
 esac done
23
 
23
 
24
-test -n "$brewroot" || brewroot=$(iniread -p get.brewroot get.ini)
24
+test -n "$brewroot" || brewroot=$(iniread -p get.brewroot)
25
 test -n "$brewroot" || die "specify '-b /path/to/brewroot or get.brewroot in get.ini"
25
 test -n "$brewroot" || die "specify '-b /path/to/brewroot or get.brewroot in get.ini"
26
 test -d "$brewroot" || die "cannot access brewroot: $brewroot"
26
 test -d "$brewroot" || die "cannot access brewroot: $brewroot"
27
 
27
 

+ 6
- 6
bin/eeiam.in View File

42
     # daemons specific to $1 location plus the rest
42
     # daemons specific to $1 location plus the rest
43
     #
43
     #
44
     test -n "$1" || usagef "location"
44
     test -n "$1" || usagef "location"
45
-    iniread -p iam.running.at.$1 iam.ini
46
-    iniread -p iam.running.at.ANYPLACE iam.ini
45
+    iniread -p iam.running.at.$1
46
+    iniread -p iam.running.at.ANYPLACE
47
 }
47
 }
48
 
48
 
49
 where_i_am() {
49
 where_i_am() {
50
     #
50
     #
51
     # what is my physical location?
51
     # what is my physical location?
52
     #
52
     #
53
-    if=$(iniread -p iam.using.if iam.ini)
53
+    if=$(iniread -p iam.using.if)
54
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
54
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
55
-    iniread -p iam.seeing.gw.$gwmac iam.ini || echo OUT
55
+    iniread -p iam.seeing.gw.$gwmac || echo OUT
56
 }
56
 }
57
 
57
 
58
 start_familiar() {
58
 start_familiar() {
61
     #
61
     #
62
     local f=$1
62
     local f=$1
63
     pids_matching $f && return 0
63
     pids_matching $f && return 0
64
-    local like=$(iniread -p iam.starting.like.this.$f iam.ini)
64
+    local like=$(iniread -p iam.starting.like.this.$f)
65
     debug -v f like
65
     debug -v f like
66
     if test -n  "$like";
66
     if test -n  "$like";
67
         then
67
         then
75
     # set public status $1 by command in ini file
75
     # set public status $1 by command in ini file
76
     #
76
     #
77
     local what=$1
77
     local what=$1
78
-    iniread -p iam.saying.like.this.$what iam.ini | bash
78
+    iniread -p iam.saying.like.this.$what | bash
79
 }
79
 }
80
 
80
 
81
 
81
 

+ 1
- 1
bin/eeln.in View File

47
 }
47
 }
48
 
48
 
49
 load() {
49
 load() {
50
-    iniread -p ln.dir.$1 ln.ini | expand_tilde | debug_pipe out
50
+    iniread -p ln.dir.$1 | expand_tilde | debug_pipe out
51
 }
51
 }
52
 
52
 
53
 while true;
53
 while true;

+ 4
- 4
bin/eepush.in View File

7
 ffoo import ini
7
 ffoo import ini
8
 ffoo import recon
8
 ffoo import recon
9
 
9
 
10
-ORDER="$(iniread -p push.options.order push.ini)"
10
+ORDER="$(iniread -p push.options.order)"
11
 
11
 
12
 while true; do case $1 in
12
 while true; do case $1 in
13
     -d|--debug)     FFOO_DEBUG=true;    shift;      ;;
13
     -d|--debug)     FFOO_DEBUG=true;    shift;      ;;
19
     *)              hosts="$1"; shift;              ;;
19
     *)              hosts="$1"; shift;              ;;
20
 esac done
20
 esac done
21
 
21
 
22
-test -n "$hosts" || hosts=$(iniread -s push.hosts push.ini | debug_pipe ini_hosts)
22
+test -n "$hosts" || hosts=$(iniread -s push.hosts | debug_pipe ini_hosts)
23
 debug -v hosts
23
 debug -v hosts
24
 
24
 
25
 test -n "$hosts" || die "no valid hosts to begin with"
25
 test -n "$hosts" || die "no valid hosts to begin with"
26
-paths=$(iniread -s push.paths push.ini)
26
+paths=$(iniread -s push.paths)
27
 test -n "$paths" || die "no valid paths to begin with"
27
 test -n "$paths" || die "no valid paths to begin with"
28
 
28
 
29
 think "Probing & sorting paths"
29
 think "Probing & sorting paths"
81
 
81
 
82
 for host in $hosts;
82
 for host in $hosts;
83
 do
83
 do
84
-    iniread -s push.commands push.ini \
84
+    iniread -s push.commands \
85
       | grep . \
85
       | grep . \
86
       | while read cmd;
86
       | while read cmd;
87
         do
87
         do

+ 2
- 2
bin/eerevert.in View File

54
 
54
 
55
 test -z "$snapshot" && {
55
 test -z "$snapshot" && {
56
     think "looking for $domain in revert.ini"
56
     think "looking for $domain in revert.ini"
57
-    snapshot=$(iniread -1 -p revert.to.snapshot.$domain revert.ini)
57
+    snapshot=$(iniread -1 -p revert.to.snapshot.$domain)
58
 }
58
 }
59
 test -z "$snapshot" && {
59
 test -z "$snapshot" && {
60
     think "looking for default snapshot name in revert.ini"
60
     think "looking for default snapshot name in revert.ini"
61
-    snapshot=$(iniread -1 -p revert.to.snapshot._default_ revert.ini)
61
+    snapshot=$(iniread -1 -p revert.to.snapshot._default_)
62
 }
62
 }
63
 test -z "$snapshot" && {
63
 test -z "$snapshot" && {
64
     die "could not determine snapshot for $domain"
64
     die "could not determine snapshot for $domain"

+ 1
- 1
bin/eewww.in View File

11
 
11
 
12
 test -z "$uri" && uri="$(echo "$*" | find_uri)"
12
 test -z "$uri" && uri="$(echo "$*" | find_uri)"
13
 test -z "$uri" && uri="$(clipln | find_uri)"
13
 test -z "$uri" && uri="$(clipln | find_uri)"
14
-test -z "$uri" && uri="$(iniread -p www.bookmark.default www.ini)"
14
+test -z "$uri" && uri="$(iniread -p www.bookmark.default)"
15
 #test -z "$uri" && uri="http://www.example.com/"
15
 #test -z "$uri" && uri="http://www.example.com/"
16
 
16
 
17
 echo $uri
17
 echo $uri