File: donate.tcl

package info (click to toggle)
din 5.2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,200 kB
  • sloc: cpp: 9,369; sh: 6,563; ansic: 2,977; tcl: 1,770; makefile: 283
file content (24 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
set browser {}

proc check-browser what {
  global browser
  if {[catch {exec which $what} results]} {
    set browser {}
    return
  }
  set browser $results
}

check-browser firefox
if {$browser ne ""} {
  exec firefox http://dinisnoise.org/donate/ >& /dev/null &
  return
}

check-browser google-chrome
if {$browser ne ""} {
  exec google-chrome http://dinisnoise.org/donate/ >& /dev/null &
  return
} else {
  echo Please visit http://dinisnoise.org/donate/ to make a donation!
}