Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 85 lines (69 sloc) 1.859 kb
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
#!/bin/bash
#
# webconverger configuration file
#

webc_id=`cat /etc/webc/id 2>/dev/null || echo "unknown-uuid"`
webc_version=$( git describe --always 2>/dev/null || echo 12.3)

# Default location for system wide preferences
prefs=/opt/firefox/defaults/preferences/webc-boot.js

# Default location for Webconverger extension
link='/opt/firefox/extensions/kiosk@webconverger.com'

# updates
updates_url="http://updates.webconverger.com/${webc_id}"
updates_manifest="manifest"
# persistent, so we don't re-run updates
updates_cache_dir="/var/tmp/updates/${webc_version}"

# installed config trumps boot cmdline
cmdline()
{
test -e /proc/cmdline && cat /proc/cmdline
test -e /etc/webc/cmdline && cat /etc/webc/cmdline
}

install_base_url="http://config.webconverger.com/clients"
install_qa_url="${install_base_url}/?v=${webc_version}&id=${webc_id}&$(cmdline | /usr/bin/tr -s '[:space:]' '&')"
config_url="${install_base_url}/install-config/${webc_id}"

# triggers live-config.sh - this gets config from config.webconverger.com
live_config_pipe="/tmp/live-config.pipe" # needs to be writable by xinitrc
# triggers updates.sh - this gets any other scriptable updates
updates_pipe="/tmp/updates.pipe" # needs to be writable by xinitrc

logs ()
{
logger -t $0 -p daemon.info "$@"
}

cmdline_has()
{
for i in `cmdline`
do
test "$1" = "${i%%=*}" && return 0
done
return 1
}

cmdline_get()
{
for i in `cmdline`; do
test ${i/=*} = $1 && { echo "${i#$1=}"; return 0; }
done
return 1
}

mac_address()
{
for i in /sys/class/net/*/address; do
tr -d ":" < $i
return
done
}

wait_for()
{
tmp=$(mktemp -u)
mkfifo $tmp
inotifywait -m --format=%f -e create "${1%/*}" > $tmp 2>&1 &
while read output
do
case $output in "Watches established.") test -p "$1" && break ;; "${1##*/}") break ;; esac
done < $tmp
rm -f $tmp
}



has_network()
{
netstat -rn | grep -qs '^0.0.0.0'
}
Something went wrong with that request. Please try again.