#!/bin/bash # Verifica se o script é executado com privilégios de root if [ "$(id -u)" -ne 0 ]; then echo "Este script precisa ser executado com privilégios de root." exit 1 fi # Define as variáveis de instalação APP_DIR="/usr/local/wifihashapp2" BIN_DIR="/usr/local/bin" DESKTOP_DIR="/usr/share/applications" # Cria o diretório de instalação mkdir -p "$APP_DIR" # Copia os arquivos do aplicativo cp -r ./* "$APP_DIR/" # Cria um link simbólico para o executável do aplicativo ln -s "$APP_DIR/main.py" "$BIN_DIR/wifihashapp2" # Cria um atalho no menu de aplicativos (opcional) cat > "$DESKTOP_DIR/wifihashapp2.desktop" <<EOL [Desktop Entry] Name=WifiHashApp2 Exec=wifihashapp2 Type=Application Terminal=false EOL # Define as permissões adequadas chmod -R 755 "$APP_DIR" chmod +x "$BIN_DIR/wifihashapp2" echo "WifiHashApp2 foi instalado com sucesso!"
Write, Run & Share Bash code online using OneCompiler's Online Bash Shell for free. It's one of the robust, feature-rich Bash shell available over online and getting started with the OneCompiler's Bash Shell is simple and pretty fast. The editor shows sample boilerplate code when you choose language as Bash
. OneCompiler also has reference scripts, where you can look for the sample scripts and start coding.
Bash (Bourne Again Shell) is a shell program written by Brian Fox and is an upgraded version of Bourne Shell program 'sh'.
name="Foo"
echo $name
echo "$name"
echo "${name}"
if [ conditional-expression ]
then
statements
fi
if [ conditional-expression ]
then
statements
else
statements
fi
if [ conditional-expression ]
then
statements
elif [ conditional-expression ]
then
statements
else
statements
fi