~pwlars/phablet-tools/wait-for-dns

« back to all changes in this revision

Viewing changes to phablet-test-run

  • Committer: Omer Akram
  • Date: 2013-06-04 12:56:12 UTC
  • mto: This revision was merged to the branch mainline in revision 103.
  • Revision ID: om26er@ubuntu.com-20130604125612-1oqhfkxnk2ozj55a
now there is only one service file, so no need to detect which platform we are on

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
SETUPDEVICE=0
27
27
NOSHELL=0
28
28
RETVAL=0
 
29
SERVICEFILE="/data/ubuntu/etc/device-services"
29
30
 
30
31
print_usage() {
31
32
    cat << EOF 
90
91
    fi
91
92
}
92
93
 
93
 
get_service_file() {
94
 
    DEVICENAME=$(adb -s $ANDROID_SERIAL shell grep ^ro.product.device= /system/build.prop |sed -e 's/.*=//' | tr -d '\n\r')
95
 
    CONFFILE=/data/ubuntu/etc/ubuntu-session.d/$DEVICENAME.conf
96
 
    FORM_FACTOR=$(adb -s $ANDROID_SERIAL shell grep ^FORM_FACTOR= $CONFFILE |sed -e 's/.*=//' | tr -d '\n\r\"')
97
 
    if [ "$FORM_FACTOR" = "phone" ]; then
98
 
        echo /data/ubuntu/etc/phone-services
99
 
    else
100
 
        echo /data/ubuntu/etc/tablet-services
101
 
    fi
102
 
}
103
 
 
104
94
disable_shell() {
105
 
    SERVICEFILE=$(get_service_file)
106
95
    adb -s $ANDROID_SERIAL shell "grep qml-phone-shell $SERVICEFILE > /dev/null"
107
96
    CONTAINS_SHELL=$?
108
97
    if [ $CONTAINS_SHELL -eq 0 ]; then
114
103
}
115
104
 
116
105
restore_shell() {
117
 
    SERVICEFILE=$(get_service_file)
118
106
    adb -s $ANDROID_SERIAL shell cp $SERVICEFILE.backup $SERVICEFILE
119
107
    adb -s $ANDROID_SERIAL shell "chroot /data/ubuntu /usr/bin/service ubuntu-session restart > /dev/null"
120
108
}