<commit_before>#!/bin/bash

# set volume to 88%
sudo -u nao pactl set-sink-mute 0 false
sudo -u nao pactl set-sink-volume 0 88%

# play initial sound
sudo -u nao /usr/bin/paplay /home/nao/naoqi/Media/usb_start.wav

# stop naoqi and/or naoth if they are to replace
if [ -f "./deploy/home/nao/bin/naoth" ]; then
  /etc/init.d/naoth stop
fi
if [ -f "./deploy/home/nao/bin/libnaosmal.so" ]; then
  /etc/init.d/naoqi stop
fi

# backup the stuff from the robot
rm -rf ./backup
sudo -u nao mkdir ./backup
sudo -u nao cp -r /home/nao/naoqi/Config ./backup
sudo -u nao cp -r /home/nao/bin ./backup

# remove files that will be copied and copy the new ones
if [ -d "./deploy/home/nao/naoqi/Config" ]; then
  rm -rf /home/nao/Config/general
  rm -rf /home/nao/Config/platform
  rm -rf /home/nao/Config/robots
  rm -rf /home/nao/Config/robot_heads
  rm -rf /home/nao/Config/scheme
  rm -rf /home/nao/Config/private
  rm -f /home/nao/Config/scheme.cfg
  rm -f /home/nao/Config/behavior-ic.dat
  rm -f /home/nao/Config/reachability_grid.dat
  
  sudo -u nao cp -r ./deploy/home/nao/naoqi/Config/* /home/nao/Config/
fi

# copy binaries and start naoqi/naoth again
if [ -f "./deploy/home/nao/bin/libnaosmal.so" ]; then
  rm -f /home/nao/bin/libnaosmal.so
  sudo -u nao cp ./deploy/home/nao/bin/libnaosmal.so /home/nao/bin/libnaosmal.so
  /etc/init.d/naoqi start
fi

if [ -f "./deploy/home/nao/bin/naoth" ]; then
  rm -f /home/nao/bin/naoth
  sudo -u nao cp ./deploy/home/nao/bin/naoth /home/nao/bin/naoth
  sudo -u nao chmod 755 /home/nao/bin/naoth
  /etc/init.d/naoth start<commit_msg>Use naoth script directly instead of /etc/init.d/naoth .<commit_after>#!/bin/bash

# set volume to 88%
sudo -u nao pactl set-sink-mute 0 false
sudo -u nao pactl set-sink-volume 0 88%

# play initial sound
sudo -u nao /usr/bin/paplay /home/nao/naoqi/Media/usb_start.wav

# stop naoqi and/or naoth if they are to replace
if [ -f "./deploy/home/nao/bin/naoth" ]; then
  naoth stop
fi
if [ -f "./deploy/home/nao/bin/libnaosmal.so" ]; then
  /etc/init.d/naoqi stop
fi

# backup the stuff from the robot
rm -rf ./backup
sudo -u nao mkdir ./backup
sudo -u nao cp -r /home/nao/naoqi/Config ./backup
sudo -u nao cp -r /home/nao/bin ./backup

# remove files that will be copied and copy the new ones
if [ -d "./deploy/home/nao/naoqi/Config" ]; then
  rm -rf /home/nao/Config/general
  rm -rf /home/nao/Config/platform
  rm -rf /home/nao/Config/robots
  rm -rf /home/nao/Config/robot_heads
  rm -rf /home/nao/Config/scheme
  rm -rf /home/nao/Config/private
  rm -f /home/nao/Config/scheme.cfg
  rm -f /home/nao/Config/behavior-ic.dat
  rm -f /home/nao/Config/reachability_grid.dat
  
  sudo -u nao cp -r ./deploy/home/nao/naoqi/Config/* /home/nao/Config/
fi

# copy binaries and start naoqi/naoth again
if [ -f "./deploy/home/nao/bin/libnaosmal.so" ]; then
  rm -f /home/nao/bin/libnaosmal.so
  sudo -u nao cp ./deploy/home/nao/bin/libnaosmal.so /home/nao/bin/libnaosmal.so
  /etc/init.d/naoqi start
fi

if [ -f "./deploy/home/nao/bin/naoth" ]; then
  rm -f /home/nao/bin/naoth
  sudo -u nao cp ./deploy/home/nao/bin/naoth /home/nao/bin/naoth
  sudo -u nao chmod 755 /home/nao/bin/naoth
  naoth start
{'fraction_non_alphanumeric': 0.14783159227603673, 'fraction_numerical': 0.005698005698005698, 'mean_word_length': 2.653179190751445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3614597', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1338, 'n_words': 348}