Changing some files related to the update process

This commit is contained in:
Félix Aime 2021-02-18 22:53:49 +01:00
parent 9382a1fd9f
commit b2d153bb17
4 changed files with 22 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<div class="controls" v-if="display">
<i class="off-icon" v-on:click="action('shutdown')" v-if="off_available"></i>
<i class="quit-icon" v-on:click="action('quit')" v-if="quit_available"></i>
<i :class="[ update_available ? 'update-icon' :'no-update-icon' ]" v-if="update_possibe" @click="$router.push({ name: 'update' })"></i>
<i :class="[ update_available ? 'update-icon' :'no-update-icon' ]" @click="$router.push({ name: 'update' })"></i>
</div>
</template>
<script>

View File

@ -50,6 +50,7 @@ frontend:
sparklines: true
virtual_keyboard: true
user_lang: userlang
update: updateoption
# NETWORK -
# Some elements related to the network configuration, such as

View File

@ -97,6 +97,19 @@ set_kioskmode() {
fi
}
set_update() {
echo -n "[?] Do you want to be able to update TinyCheck from the frontend interface? [Yes/No] "
read answer
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
then
sed -i "s/updateoption/true/g" /usr/share/tinycheck/config.yaml
echo -e "\e[92m [✔] You'll be able to update it from the frontend!\e[39m"
else
sed -i "s/updateoption/false/g" /usr/share/tinycheck/config.yaml
echo -e "\e[92m [✔] You'll need to pass by the console script to update TinyCheck.\e[39m"
fi
}
create_directory() {
# Create the TinyCheck directory and move the whole stuff there.
echo -e "[+] Creating TinyCheck folder under /usr/share/"

View File

@ -7,7 +7,7 @@ fi
if [ $PWD = "/usr/share/tinycheck" ]; then
echo "[+] Cloning the current repository to /tmp/"
rm -rf /tmp/tinycheck/ &> /dev/null
cd /tmp/ && git clone https://github.com/KasperskyLab/tinycheck
cd /tmp/ && git clone --branch update-feature https://github.com/KasperskyLab/tinycheck
cd /tmp/tinycheck && bash update.sh
elif [ $PWD = "/tmp/tinycheck" ]; then
@ -61,6 +61,10 @@ elif [ $PWD = "/tmp/tinycheck" ]; then
sed -i 's/analysis:/analysis:\n active: true/g' /usr/share/tinycheck/config.yaml
fi
if ! grep -q update /usr/share/tinycheck/config.yaml; then
sed -i 's/frontend:/frontend:\n update: true/g' /usr/share/tinycheck/config.yaml
fi
if ! grep -q "CN=R3,O=Let's Encrypt,C=US" /usr/share/tinycheck/config.yaml; then
sed -i "s/free_issuers:/free_issuers:\n - CN=R3,O=Let's Encrypt,C=US/g" /usr/share/tinycheck/config.yaml
fi