Compare commits

..

16 Commits

Author SHA1 Message Date
Félix Aime 9ad538862e Changing FR translation 2021-02-19 16:42:07 +01:00
Félix Aime ee1f89e45f Changes for prod 2021-02-19 16:40:52 +01:00
Félix Aime 79f6c09cc9 Changes for tests 2021-02-19 16:18:32 +01:00
Félix Aime b0869a94c9 Updating install script 2021-02-19 15:49:47 +01:00
Félix Aime a5f84f35de Removing update-feature branch 2021-02-19 15:46:33 +01:00
Félix Aime 0b64402f74 Deleting unused translation var 2021-02-19 15:32:58 +01:00
Félix Aime c8d667f5c5 Adding few stuff related to updates 2021-02-19 15:31:30 +01:00
Félix Aime dc37b6a2da Color changes 2021-02-19 14:38:16 +01:00
Félix Aime 8890ed1b26 Changing timeout 2021-02-19 14:33:23 +01:00
Félix Aime 6b6c9bb368 Changing timeout 2021-02-19 14:18:32 +01:00
Félix Aime 7acc61d80d Adding version info 2021-02-19 14:08:14 +01:00
Félix Aime ecf1281290 Adding version info 2021-02-19 13:56:21 +01:00
Félix Aime 6350241a35 Issue with API URL corrected. 2021-02-19 13:33:02 +01:00
Félix Aime 8d64b3bc9a Some changes for the GUI 2021-02-19 13:20:18 +01:00
Félix Aime 6790b17f86 Changes to get the current version 2021-02-19 10:57:11 +01:00
Félix Aime 5a133d0d17 No new line in the VERSION file 2021-02-19 10:46:29 +01:00
20 changed files with 132 additions and 100 deletions
+8
View File
@@ -55,11 +55,19 @@
this.set_lang(); this.set_lang();
}) })
.catch(error => { console.log(error) }); .catch(error => { console.log(error) });
},
get_version: function() {
axios.get('/api/update/get-version', { timeout: 60000 })
.then(response => {
if(response.data.status) window.current_version = response.data.current_version
})
.catch(error => { console.log(error) });
} }
}, },
created: function() { created: function() {
window.config = {} window.config = {}
this.get_config(); this.get_config();
this.get_version();
} }
} }
</script> </script>
+8 -36
View File
@@ -683,17 +683,6 @@ ul {
opacity: 0.1; opacity: 0.1;
} }
.no-update-icon {
background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aW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zLDczLjcsMzguNSw3MywzOS4zeiI+PC9wYXRoPjwvZz48L3N3aXRjaD48L3N2Zz4=");
width: 30px;
height: 30px;
display: block;
margin-right: 10px;
margin-top: 10px;
background-size: cover;
opacity: 0.1;
}
.update-icon { .update-icon {
background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjZmY4YjAwIiB4bWxuczp4PSJodHRwOi8vbnMuYWRvYmUuY29tL0V4dGVuc2liaWxpdHkvMS4wLyIgeG1sbnM6aT0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB4bWxuczpncmFwaD0iaHR0cDovL25zLmFkb2JlLmNvbS9HcmFwaHMvMS4wLyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMCAxMDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3dpdGNoPjxmb3JlaWduT2JqZWN0IHJlcXVpcmVkRXh0ZW5zaW9ucz0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj48L2ZvcmVpZ25PYmplY3Q+PGcgaTpleHRyYW5lb3VzPSJzZWxmIj48Zz48cGF0aCBkPSJNNTI3My4xLDI0MDAuMXYtMmMwLTIuOC01LTQtOS43LTRzLTkuNywxLjMtOS43LDR2MmMwLDEuOCwwLjcsMy42LDIsNC45bDUsNC45YzAuMywwLjMsMC40LDAuNiwwLjQsMXY2LjQgICAgIGMwLDAuNCwwLjIsMC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SwyLjQtNS4zLDUuMy01LjNjMi45LDAsNS4zLDIuNCw1LjMsNS4zdjI2LjVjMCwyLjktMi40LDUuMy01LjMsNS4zYy0yLjksMC01LjMtMi40LTUuMy01LjNWMjYuM3ogTTUwLDc4LjcgICAgYy0zLjgsMC02LjktMy4xLTYuOS02LjlzMy4xLTYuOSw2LjktNi45czYuOSwzLjEsNi45LDYuOVM1My44LDc4LjcsNTAsNzguN3oiPjwvcGF0aD48L2c+PC9zd2l0Y2g+PC9zdmc+");
width: 30px; width: 30px;
@@ -705,16 +694,6 @@ ul {
opacity: 0.2; opacity: 0.2;
} }
.fail-update-icon {
background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMzUzNTM1IiB4bWxuczp4PSJodHRwOi8vbnMuYWRvYmUuY29tL0V4dGVuc2liaWxpdHkvMS4wLyIgeG1sbnM6aT0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB4bWxuczpncmFwaD0iaHR0cDovL25zLmFkb2JlLmNvbS9HcmFwaHMvMS4wLyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMCAxMDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3dpdGNoPjxmb3JlaWduT2JqZWN0IHJlcXVpcmVkRXh0ZW5zaW9ucz0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj48L2ZvcmVpZ25PYmplY3Q+PGcgaTpleHRyYW5lb3VzPSJzZWxmIj48cGF0aCBkPSJNNTAsMi41QzIzLjgsMi41LDIuNSwyMy44LDIuNSw1MGMwLDI2LjIsMjEuMyw0Ny41LDQ3LjUsNDcuNVM5Ny41LDc2LjIsOTcuNSw1MEM5Ny41LDIzLjgsNzYuMiwyLjUsNTAsMi41eiBNNzMsMzkuMyAgICBMNDUuNyw2OS40Yy0wLjcsMC44LTIsMC44LTIuOCwwLjFMMjUuOSw1Mi40Yy0wLjgtMC44LTAuOC0yLDAtMi43bDUtNWMwLjgtMC44LDItMC44LDIuNywwTDQ0LDU1LjJMNjUsMzIgICAgYzAuNy0wLjgsMS45LTAuOCwyLjctMC4xbDUuMiw0LjdDNzMuNywzNy4zLDczLjcsMzguNSw3MywzOS4zeiI+PC9wYXRoPjwvZz48L3N3aXRjaD48L3N2Zz4=");
width: 30px;
height: 30px;
display: block;
margin-right: 10px;
margin-top: 10px;
background-size: cover;
opacity: 0.2;
}
.off-icon:hover { .off-icon:hover {
opacity: 0.3; opacity: 0.3;
@@ -726,26 +705,19 @@ ul {
cursor:pointer; cursor:pointer;
} }
.no-update-icon:hover {
opacity: 0.3;
cursor:pointer;
}
.fail-update-icon:hover {
opacity: 0.3;
cursor:pointer;
}
.update-icon:hover { .update-icon:hover {
opacity: 0.4; opacity: 0.4;
cursor:pointer; cursor:pointer;
} }
.green-strong { sup {
font-weight: bold; top: -2em;
color: #54dc4b; font-size: 12px;
left: -0.2em;
color: #CCC;
font-family: 'Lobster';
} }
.orange-strong { .color-green {
font-weight: bold; color:#35c435;
color: #f57d16cf;
} }
+8 -5
View File
@@ -2,7 +2,7 @@
<div class="controls" v-if="display"> <div class="controls" v-if="display">
<i class="off-icon" v-on:click="action('shutdown')" v-if="off_available"></i> <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="quit-icon" v-on:click="action('quit')" v-if="quit_available"></i>
<i :class="[ update_available ? 'update-icon' :'no-update-icon' ]" @click="$router.push({ name: 'update' })"></i> <i class="update-icon" v-if="update_available&&update_possible" @click="$router.push({ name: 'update' })"></i>
</div> </div>
</template> </template>
<script> <script>
@@ -14,7 +14,7 @@ export default {
return { return {
display: true, display: true,
update_available: false, update_available: false,
update_possible: true, update_possible: false,
quit_available: false, quit_available: false,
off_available: false off_available: false
} }
@@ -33,11 +33,14 @@ export default {
.then(response => { .then(response => {
if(response.data.status) { if(response.data.status) {
if(response.data.message == "A new version is available"){ if(response.data.message == "A new version is available"){
// Allow to show the warning chip.
this.update_available = true this.update_available = true
this.update_possible = true this.update_possible = true
} else if(response.data.message == "This is the latest version"){
this.update_available = false // Pass the versions as "global vars" through window variable.
this.update_possible = true window.current_version = response.data.current_version
window.next_version = response.data.next_version
} }
} else { } else {
this.update_possible = false this.update_possible = false
+7
View File
@@ -78,5 +78,12 @@
"tap_msg": "Podeu tocar la tecla USB per iniciar una nova captura.", "tap_msg": "Podeu tocar la tecla USB per iniciar una nova captura.",
"capture_download": "La descàrrega de la captura començarà ...", "capture_download": "La descàrrega de la captura començarà ...",
"start_capture_btn": "Inicia una altra captura" "start_capture_btn": "Inicia una altra captura"
},
"update": {
"tinycheck_needs": "TinyCheck ha d´actualitzar-se a la propera versió",
"please_click": "Feu click al botó de sota per actualitzar",
"the_process": "El procés pot trigar uns minuts, si us plau esperi ...",
"update_finished": "Actualització finalitzada, actualitzant la interfície...",
"update_it": "Actualitzar ara"
} }
} }
+7
View File
@@ -78,5 +78,12 @@
"tap_msg": "You can tap the USB key to start a new capture.", "tap_msg": "You can tap the USB key to start a new capture.",
"capture_download": "The capture download is going to start...", "capture_download": "The capture download is going to start...",
"start_capture_btn": "Start another capture" "start_capture_btn": "Start another capture"
},
"update": {
"tinycheck_needs": "TinyCheck needs to be updated to the next version",
"please_click": "Please click on the button below to update it.",
"the_process": "The process can take few minutes, please wait...",
"update_finished": "Update finished, let's refresh the interface...",
"update_it": "Update it now"
} }
} }
+7
View File
@@ -78,5 +78,12 @@
"tap_msg": "Puede tocar la llave USB para iniciar una nueva captura", "tap_msg": "Puede tocar la llave USB para iniciar una nueva captura",
"capture_download": "La descarga de la captura va a comenzar ...", "capture_download": "La descarga de la captura va a comenzar ...",
"start_capture_btn": "Iniciar otra captura" "start_capture_btn": "Iniciar otra captura"
},
"update": {
"tinycheck_needs": "TinyCheck debe actualizarse a la próxima versión",
"please_click": "Haga click en el botón de abajo para actualizar",
"the_process": "El proceso puede tardar unos minutos, por favor espere ...",
"update_finished": "Actualización finalizada, actualizando la interfaz...",
"update_it": "Actualizar ahora"
} }
} }
+7
View File
@@ -78,5 +78,12 @@
"tap_msg": "Vous pouvez appuyer sur l'animation pour lancer une nouvelle capture.", "tap_msg": "Vous pouvez appuyer sur l'animation pour lancer une nouvelle capture.",
"capture_download": "Le téléchargement de la capture va se lancer...", "capture_download": "Le téléchargement de la capture va se lancer...",
"start_capture_btn": "Lancer une nouvelle capture" "start_capture_btn": "Lancer une nouvelle capture"
},
"update": {
"tinycheck_needs": "Une nouvelle mise à jour de TinyCheck est disponible",
"please_click": "Cliquez sur le bouton ci-dessous pour le mettre à jour",
"the_process": "La mise à jour peut prendre plusieurs minutes, merci d'attendre...",
"update_finished": "Mise à jour terminée, vous allez être redirigé...",
"update_it": "Mettre TinyCheck à jour"
} }
} }
+1 -2
View File
@@ -25,8 +25,7 @@ export default {
question: true, question: true,
running: false, running: false,
check_alerts: false, check_alerts: false,
long_waiting: false, long_waiting: false
translation: {}
} }
}, },
props: { props: {
+1 -2
View File
@@ -29,8 +29,7 @@ export default {
loading: false, loading: false,
stats_interval: false, stats_interval: false,
chrono_interval: false, chrono_interval: false,
sparklines: false, sparklines: false
translation: {}
} }
}, },
props: { props: {
+1 -2
View File
@@ -55,8 +55,7 @@ export default {
interval: false, interval: false,
error: false, error: false,
reboot_option: window.config.reboot_option, reboot_option: window.config.reboot_option,
attempts: 3, attempts: 3
translation: {}
} }
}, },
methods: { methods: {
+6 -2
View File
@@ -1,6 +1,6 @@
<template> <template>
<div class="center"> <div class="center">
<h3 class="lobster">{{ $t("home.welcome_msg") }}</h3> <h3 class="lobster">{{ $t("home.welcome_msg") }}<sup>{{current_version}}</sup></h3>
<p>{{ $t("home.help_msg") }}</p> <p>{{ $t("home.help_msg") }}</p>
<button class="btn btn-primary" v-on:click="next()">{{ $t("home.start_btn") }}</button> <button class="btn btn-primary" v-on:click="next()">{{ $t("home.start_btn") }}</button>
</div> </div>
@@ -14,7 +14,7 @@ export default {
props: { saved_ssid: String, list_ssids: Array, internet: Boolean }, props: { saved_ssid: String, list_ssids: Array, internet: Boolean },
data() { data() {
return { return {
translation: {}, current_version:""
} }
}, },
methods: { methods: {
@@ -31,6 +31,10 @@ export default {
internet: internet } }); internet: internet } });
} }
} }
},
created: function() {
if ('current_version' in window)
this.current_version = window.current_version
} }
} }
</script> </script>
+1 -2
View File
@@ -99,8 +99,7 @@ export default {
name: 'report', name: 'report',
data() { data() {
return { return {
results: true, results: true
translation: {}
} }
}, },
props: { props: {
+1 -2
View File
@@ -144,8 +144,7 @@ export default {
usb: false, usb: false,
saved: false, saved: false,
save_usb: false, save_usb: false,
init: false, init: false
translation: {}
} }
}, },
props: { props: {
+2 -2
View File
@@ -20,7 +20,7 @@
}, },
methods: { methods: {
internet_check: function() { internet_check: function() {
axios.get('/api/network/status', { timeout: 10000 }) axios.get('/api/network/status', { timeout: 30000 })
.then(response => { .then(response => {
if (response.data.internet) this.internet = true if (response.data.internet) this.internet = true
if (window.config.iface_out.charAt(0) == 'e') { if (window.config.iface_out.charAt(0) == 'e') {
@@ -32,7 +32,7 @@
.catch(err => (console.log(err))) .catch(err => (console.log(err)))
}, },
get_wifi_networks: function() { get_wifi_networks: function() {
axios.get('/api/network/wifi/list', { timeout: 10000 }) axios.get('/api/network/wifi/list', { timeout: 30000 })
.then(response => { .then(response => {
this.list_ssids = response.data.networks this.list_ssids = response.data.networks
this.goto_home(); this.goto_home();
+26 -32
View File
@@ -1,20 +1,11 @@
<template> <template>
<div class="center"> <div class="center">
<div v-if="update_possible"> <p><strong>{{ $t("update.tinycheck_needs") }} ({{next_version}}).</strong><br />
<div v-if="update_available"> <span v-if="!update_launched">{{ $t("update.please_click") }}</span>
<p><span class="orange-strong">TinyCheck needs to be updated.</span><br /> <span v-if="update_launched&&!update_finished">{{ $t("update.the_process") }}</span>
<span v-if="!update_launched">Please click on the button below to update it.</span> <span v-if="update_launched&&update_finished" class="color-green"> {{ $t("update.update_finished") }}</span>
<span v-else>The process can take few minutes, please wait...</span>
</p> </p>
<button class="btn btn-primary" :class="[ update_launched ? 'loading' : '' ]" v-on:click="launch_update()">Update it now</button> <button class="btn btn-primary" :class="[ update_launched ? 'loading' : '' ]" v-on:click="launch_update()" v-if="!update_finished">{{ $t("update.update_it") }}</button>
</div>
<div v-else>
<p><span class="green-strong">Your TinyCheck instance is up-to-date!</span><br />You'll be redirected in few seconds.</p>
</div>
</div>
<div v-else>
<p><strong>You dont have Internet or the rights to update Tinycheck.</strong><br />You'll be redirected in few seconds.</p>
</div>
</div> </div>
</template> </template>
@@ -26,30 +17,24 @@
data() { data() {
return { return {
translation: {}, translation: {},
update_available: null,
update_possible: true,
update_launched: null, update_launched: null,
check_interval: null check_interval: null,
next_version: null,
current_version: null,
update_finished: false
} }
}, },
methods: { methods: {
check_update: function() { check_version: function() {
axios.get('/api/update/check', { timeout: 60000 }) axios.get('/api/update/get-version', { timeout: 60000 })
.then(response => { .then(response => {
console.log(response.data.status)
if(response.data.status) { if(response.data.status) {
if(response.data.message == "A new version is available"){ if(response.data.current_version == window.next_version){
this.update_available = true window.current_version = response.data.current_version
this.update_possible = true this.update_finished = true
} else if (response.data.message == "This is the latest version"){
this.update_available = false
this.update_possible = true
clearInterval(this.check_interval); clearInterval(this.check_interval);
setTimeout(function () { window.location.href = "/"; }.bind(this), 3000); setTimeout(function () { window.location.href = "/"; }, 10000)
} }
} else {
this.update_possible = false
setTimeout(function () { window.location.href = "/"; }.bind(this), 3000);
} }
}) })
.catch(error => { console.log(error) }); .catch(error => { console.log(error) });
@@ -60,7 +45,7 @@
if(response.data.status) { if(response.data.status) {
if(response.data.message == "Update successfully launched"){ if(response.data.message == "Update successfully launched"){
this.update_launched = true this.update_launched = true
this.check_interval = setInterval(function(){ this.check_update(); }.bind(this), 3000); this.check_interval = setInterval(function(){ this.check_version(); }.bind(this), 3000);
} }
} }
}) })
@@ -68,7 +53,16 @@
} }
}, },
created: function() { created: function() {
this.check_update(); if ('next_version' in window && 'current_version' in window){
if (window.current_version != window.next_version){
this.next_version = window.next_version
this.current_version = window.current_version
} else {
window.location.href = "/";
}
} else {
window.location.href = "/";
}
} }
} }
</script> </script>
+1 -2
View File
@@ -72,8 +72,7 @@ export default {
virtual_keyboard: window.config.virtual_keyboard, virtual_keyboard: window.config.virtual_keyboard,
have_internet: false, have_internet: false,
enter_creds: false, enter_creds: false,
refreshing: false, refreshing: false
translation: {}
} }
}, },
props: { props: {
+2 -1
View File
@@ -118,7 +118,7 @@ create_directory() {
} }
get_version() { get_version() {
git tag | tail -n 1 > /usr/share/tinycheck/VERSION git tag | tail -n 1 | xargs echo -n > /usr/share/tinycheck/VERSION
} }
generate_certificate() { generate_certificate() {
@@ -465,6 +465,7 @@ else
set_userlang set_userlang
set_credentials set_credentials
set_kioskmode set_kioskmode
set_update
check_dependencies check_dependencies
configure_dnsmask configure_dnsmask
configure_dhcpcd configure_dhcpcd
+6
View File
@@ -13,6 +13,12 @@ def check():
return jsonify(Update().check_version()) return jsonify(Update().check_version())
@update_bp.route("/get-version", methods=["GET"])
def get_version():
""" Check the current version """
return jsonify(Update().get_current_version())
@update_bp.route("/process", methods=["GET"]) @update_bp.route("/process", methods=["GET"])
def process(): def process():
""" Check the presence of new version """ """ Check the presence of new version """
+29 -7
View File
@@ -20,7 +20,8 @@ class Update(object):
""" """
Check if a new version of TinyCheck is available Check if a new version of TinyCheck is available
by quering the Github api and comparing the last by quering the Github api and comparing the last
tag with the VERSION file content. tag inside the VERSION file.
:return: dict containing the available versions.
""" """
if read_config(("frontend", "update")): if read_config(("frontend", "update")):
try: try:
@@ -28,23 +29,44 @@ class Update(object):
res = json.loads(res.content.decode("utf8")) res = json.loads(res.content.decode("utf8"))
with open(os.path.join(self.app_path, "VERSION")) as f: with open(os.path.join(self.app_path, "VERSION")) as f:
if f.read() != res[0]["name"]: cv = f.read()
if cv != res[0]["name"]:
return {"status": True, return {"status": True,
"message": "A new version is available"} "message": "A new version is available",
"current_version": cv,
"next_version": res[0]["name"]}
else: else:
return {"status": True, return {"status": True,
"message": "This is the latest version"} "message": "This is the latest version",
"current_version": cv}
except: except:
return {"status": False, return {"status": False,
"message": "Something went wrong (no internet nor version file)"} "message": "Something went wrong (no API access nor version file)"}
else:
return {"status": False,
"message": "You don't have rights to do this operation."}
def get_current_version(self):
"""
Get the current version of the TinyCheck instance
:return: dict containing the current version or error.
"""
if read_config(("frontend", "update")):
try:
with open(os.path.join(self.app_path, "VERSION")) as f:
return {"status": True,
"current_version": f.read()}
except:
return {"status": False,
"message": "Something went wrong - no version file ?"}
else: else:
return {"status": False, return {"status": False,
"message": "You don't have rights to do this operation."} "message": "You don't have rights to do this operation."}
def update_instance(self): def update_instance(self):
""" """
Update the instance by executing Update the instance by executing the update script.
the update script. :return: dict containing the update status.
""" """
if read_config(("frontend", "update")): if read_config(("frontend", "update")):
try: try:
+2 -2
View File
@@ -7,7 +7,7 @@ fi
if [ $PWD = "/usr/share/tinycheck" ]; then if [ $PWD = "/usr/share/tinycheck" ]; then
echo "[+] Cloning the current repository to /tmp/" echo "[+] Cloning the current repository to /tmp/"
rm -rf /tmp/tinycheck/ &> /dev/null rm -rf /tmp/tinycheck/ &> /dev/null
cd /tmp/ && git clone --branch update-feature https://github.com/KasperskyLab/tinycheck cd /tmp/ && git clone https://github.com/KasperskyLab/tinycheck
cd /tmp/tinycheck && bash update.sh cd /tmp/tinycheck && bash update.sh
elif [ $PWD = "/tmp/tinycheck" ]; then elif [ $PWD = "/tmp/tinycheck" ]; then
@@ -75,7 +75,7 @@ elif [ $PWD = "/tmp/tinycheck" ]; then
service tinycheck-watchers restart service tinycheck-watchers restart
echo "[+] Updating the TinyCheck version" echo "[+] Updating the TinyCheck version"
cd /tmp/tinycheck && git tag | tail -n 1 > /usr/share/tinycheck/VERSION cd /tmp/tinycheck && git tag | tail -n 1 | xargs echo -n > /usr/share/tinycheck/VERSION
echo "[+] TinyCheck updated!" echo "[+] TinyCheck updated!"
fi fi