#!/bin/sh -x

if [ "$1" == "init" ];then
	if [ -e /etc/.oebuild ];then
		# work
		opkg update

		check1=`opkg list_installed python3-requests | wc -l`
		if [ "$check1" == 0 ];then
			opkg update
			opkg install python3 python3-requests
			wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
			python3 /tmp/get-pip.py
		fi
		pip3 install --upgrade pip
		pip3 install -I requests
	else
		# work
		wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
		python /tmp/get-pip.py

		pip install --upgrade pip
		pip install -I requests
	fi
fi


