-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
67 lines (54 loc) · 1.29 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
echo -e 'Hello friend...'
sleep 3
## Folders
DIR_PRENUEVOS=/home/prenuevos
DIR_ICONS=$DIR_PRENUEVOS/.icons
DIR_LOG=$DIR_ICONS/default
LOG_FILE=$DIR_LOG/th3me
DIR_STARTUP=$DIR_PRENUEVOS/.config/autostart
if [ ! -d "$DIR_STARTUP" ]; then
echo -e "Creating startup directory..."
mkdir $DIR_STARTUP
fi
if [ ! -d "$DIR_ICONS" ]; then
echo -e "Creating all directories..."
mkdir $DIR_ICONS
mkdir $DIR_LOG
fi
if [ ! -d "$DIR_LOG" ]; then
echo -e "Creating default directory..."
mkdir $DIR_LOG
fi
echo -e "Copy script..."
sleep 0.5
sudo cp main.py /usr/bin/hellofriend
echo -e "Change permisions..."
sleep 0.5
sudo chmod 755 /usr/bin/hellofriend
echo -e "Creating log file..."
sleep 0.5
sudo touch $LOG_FILE
echo -e "Change permissions of log file..."
sleep 0.5
sudo chown prenuevos:prenuevos $LOG_FILE
sudo chmod 777 $LOG_FILE
echo -e "Create startup binary..."
sleep 0.5
cat <<EOF > temp
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=hellofriend
Comment=
Exec=/usr/bin/hellofriend
StartupNotify=false
Terminal=false
Hidden=false
EOF
sudo cp temp $DIR_STARTUP/hellofriend.desktop
echo -e "Change permissions of startup binary..."
sleep 0.5
sudo chown prenuevos:prenuevos $DIR_STARTUP/hellofriend.desktop
sudo chmod 777 $DIR_STARTUP/hellofriend.desktop