Only allow the users list to be opened once

This commit is contained in:
Bob Mottram 2016-08-24 21:04:01 +01:00
parent a2e1a98b0b
commit e0a800f608
No known key found for this signature in database
GPG Key ID: 0452CC7CEA982E38
1 changed files with 13 additions and 2 deletions

View File

@ -116,6 +116,8 @@ MESH_SET_USERNAME=$"Welcome to the Freedombone mesh.\n\nThe first thing you will
# Whether to enable zeronet on the mesh # Whether to enable zeronet on the mesh
ENABLE_ZERONET= ENABLE_ZERONET=
MESH_TEXT_EDITOR='pluma'
function configure_backports { function configure_backports {
echo "deb http://${DEBIAN_REPO}/debian/ ${DEBIAN_VERSION}-backports main" >> $rootdir/etc/apt/sources.list echo "deb http://${DEBIAN_REPO}/debian/ ${DEBIAN_VERSION}-backports main" >> $rootdir/etc/apt/sources.list
} }
@ -729,6 +731,15 @@ fi
if [ \$no_of_users -gt 0 ]; then if [ \$no_of_users -gt 0 ]; then
echo "\$users_list" > /home/$MY_USERNAME/Users.txt echo "\$users_list" > /home/$MY_USERNAME/Users.txt
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt
echo 'showing_users=\$(ps aux | grep $MESH_TEXT_EDITOR | grep "Users.txt")' > /home/$MY_USERNAME/showusers
echo 'if [ \${#showing_users} -eq 0 ]; then' >> /home/$MY_USERNAME/showusers
echo ' $MESH_TEXT_EDITOR /home/$MY_USERNAME/Users.txt' >> /home/$MY_USERNAME/showusers
echo 'fi' >> /home/$MY_USERNAME/showusers
echo 'exit 0' >> /home/$MY_USERNAME/showusers
chmod +x /home/$MY_USERNAME/showusers
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/showusers
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/Users.desktop echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/Users.desktop
if [ \$no_of_users -lt 2 ]; then if [ \$no_of_users -lt 2 ]; then
echo "Name=\$no_of_users Other User" >> /home/$MY_USERNAME/Desktop/Users.desktop echo "Name=\$no_of_users Other User" >> /home/$MY_USERNAME/Desktop/Users.desktop
@ -737,14 +748,14 @@ if [ \$no_of_users -gt 0 ]; then
fi fi
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/Users.desktop echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/Users.desktop
echo 'Comment=List of users' >> /home/$MY_USERNAME/Desktop/Users.desktop echo 'Comment=List of users' >> /home/$MY_USERNAME/Desktop/Users.desktop
echo 'Exec=pluma /home/$MY_USERNAME/Users.txt' >> /home/$MY_USERNAME/Desktop/Users.desktop echo 'Exec=bash /home/$MY_USERNAME/showusers' >> /home/$MY_USERNAME/Desktop/Users.desktop
echo 'Icon=/usr/share/freedombone/avatars/anon002.jpg' >> /home/$MY_USERNAME/Desktop/Users.desktop echo 'Icon=/usr/share/freedombone/avatars/anon002.jpg' >> /home/$MY_USERNAME/Desktop/Users.desktop
echo 'StartupNotify=false' >> /home/$MY_USERNAME/Desktop/Users.desktop echo 'StartupNotify=false' >> /home/$MY_USERNAME/Desktop/Users.desktop
chmod +x /home/$MY_USERNAME/Desktop/Users.desktop chmod +x /home/$MY_USERNAME/Desktop/Users.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop
if [ ! -f /home/$MY_USERNAME/runtox ]; then if [ ! -f /home/$MY_USERNAME/runtox ]; then
echo 'qtox_running=\$(ps aux | grep qtox | grep data)' >> /home/$MY_USERNAME/runtox echo 'qtox_running=\$(ps aux | grep qtox | grep data)' > /home/$MY_USERNAME/runtox
echo 'if [ \${#qtox_running} -eq 0 ]; then' >> /home/$MY_USERNAME/runtox echo 'if [ \${#qtox_running} -eq 0 ]; then' >> /home/$MY_USERNAME/runtox
echo ' bash -c "qtox -p data"' >> /home/$MY_USERNAME/runtox echo ' bash -c "qtox -p data"' >> /home/$MY_USERNAME/runtox
echo 'fi' >> /home/$MY_USERNAME/runtox echo 'fi' >> /home/$MY_USERNAME/runtox