mirror of
https://github.com/vikt0rm/dbus-goecharger.git
synced 2025-06-25 01:11:42 +02:00
29 lines
777 B
Bash
29 lines
777 B
Bash
![]() |
#!/bin/bash
|
||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||
|
SERVICE_NAME=$(basename $SCRIPT_DIR)
|
||
|
|
||
|
# set permissions for script files
|
||
|
chmod a+x $SCRIPT_DIR/restart.sh
|
||
|
chmod 744 $SCRIPT_DIR/restart.sh
|
||
|
|
||
|
chmod a+x $SCRIPT_DIR/uninstall.sh
|
||
|
chmod 744 $SCRIPT_DIR/uninstall.sh
|
||
|
|
||
|
chmod a+x $SCRIPT_DIR/service/run
|
||
|
chmod 755 $SCRIPT_DIR/service/run
|
||
|
|
||
|
# create sym-link to run script in deamon
|
||
|
ln -s $SCRIPT_DIR/service /service/$SERVICE_NAME
|
||
|
|
||
|
# add install-script to rc.local to be ready for firmware update
|
||
|
filename=/data/rc.local
|
||
|
if [ ! -f $filename ]
|
||
|
then
|
||
|
touch $filename
|
||
|
chmod 755 $filename
|
||
|
echo "#!/bin/bash" >> $filename
|
||
|
echo >> $filename
|
||
|
fi
|
||
|
|
||
|
grep -qxF "$SCRIPT_DIR/install.sh" $filename || echo "$SCRIPT_DIR/install.sh" >> $filename
|