| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/installer/tweaks/ |
Upload File : |
#!/bin/bash
# Add this at the begining of all scripts.
if [ -f "include/startup.sh" ]; then
. include/startup.sh
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
fi
runOnceCheck
rootDir=$(rootDir)
scriptName=$(basename $BASH_SOURCE)
echo "Checking existing startup scripts folder" | log
if [ -z "$installerPath" ]; then
installerPath=$rootDir/autoconfig/$scriptName
fi
if [ ! -d "$installerPath" ]; then
mkdir -p $installerPath
fi
cp $rootDir/tweaks/extras/$scriptName/* $installerPath/
echo "Setting rc.local to the renamed file if installer is running in a provisioning process." | log
rcLocalFile=/etc/rc.local
if [ -f "$rcLocalFile.bck" ]; then
rcLocalFile=/etc/rc.local.bck
fi
if [[ ! -z $(grep $scriptName $rcLocalFile) ]]; then
echo "$0 is already installed in rc.local" | log
else
echo "Installing $scriptName in rc.local" | log
# remove "exit 0" set by default in /etc/rc.local/
sed -i -e '/exit 0/s/.*//' $rcLocalFile
echo "bash $installerPath/$scriptName" >> $rcLocalFile
# return exit 0 to /etc/rc.local
echo "exit 0" >> $rcLocalFile
fi
tagScript success
exit 0